Add WebLN types, only show zap button when WebLN is available
This commit is contained in:
parent
459bc72365
commit
797fca7111
|
@ -91,6 +91,7 @@
|
||||||
"@types/semver": "^7.3.9",
|
"@types/semver": "^7.3.9",
|
||||||
"@types/uuid": "^9.0.0",
|
"@types/uuid": "^9.0.0",
|
||||||
"@vitejs/plugin-react": "^4.0.4",
|
"@vitejs/plugin-react": "^4.0.4",
|
||||||
|
"@webbtc/webln-types": "^3.0.0",
|
||||||
"autoprefixer": "^10.4.15",
|
"autoprefixer": "^10.4.15",
|
||||||
"axios": "^1.2.2",
|
"axios": "^1.2.2",
|
||||||
"axios-mock-adapter": "^1.22.0",
|
"axios-mock-adapter": "^1.22.0",
|
||||||
|
|
|
@ -57,9 +57,7 @@ function useSignerStream() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore
|
|
||||||
await window.webln?.enable();
|
await window.webln?.enable();
|
||||||
// @ts-ignore
|
|
||||||
await window.webln?.sendPayment(reqMsg.data.params.invoice);
|
await window.webln?.sendPayment(reqMsg.data.params.invoice);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -791,7 +791,7 @@ const StatusActionBar: React.FC<IStatusActionBar> = ({
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{acceptsZaps && (
|
{(acceptsZaps && window.webln) && (
|
||||||
<StatusActionButton
|
<StatusActionButton
|
||||||
title={intl.formatMessage(messages.zap)}
|
title={intl.formatMessage(messages.zap)}
|
||||||
icon={require('@tabler/icons/bolt.svg')}
|
icon={require('@tabler/icons/bolt.svg')}
|
||||||
|
|
|
@ -24,7 +24,8 @@
|
||||||
"types": [
|
"types": [
|
||||||
"vite/client",
|
"vite/client",
|
||||||
"vitest/globals",
|
"vitest/globals",
|
||||||
"vite-plugin-compile-time/client"
|
"vite-plugin-compile-time/client",
|
||||||
|
"@webbtc/webln-types"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2902,6 +2902,11 @@
|
||||||
"@webassemblyjs/ast" "1.11.6"
|
"@webassemblyjs/ast" "1.11.6"
|
||||||
"@xtuc/long" "4.2.2"
|
"@xtuc/long" "4.2.2"
|
||||||
|
|
||||||
|
"@webbtc/webln-types@^3.0.0":
|
||||||
|
version "3.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/@webbtc/webln-types/-/webln-types-3.0.0.tgz#448b2138423865087ba8859e9e6430fc2463b864"
|
||||||
|
integrity sha512-aXfTHLKz5lysd+6xTeWl+qHNh/p3qVYbeLo+yDN5cUDmhie2ZoGvkppfWxzbGkcFBzb6dJyQ2/i2cbmDHas+zQ==
|
||||||
|
|
||||||
"@xtuc/ieee754@^1.2.0":
|
"@xtuc/ieee754@^1.2.0":
|
||||||
version "1.2.0"
|
version "1.2.0"
|
||||||
resolved "https://registry.yarnpkg.com/@xtuc/ieee754/-/ieee754-1.2.0.tgz#eef014a3145ae477a1cbc00cd1e552336dceb790"
|
resolved "https://registry.yarnpkg.com/@xtuc/ieee754/-/ieee754-1.2.0.tgz#eef014a3145ae477a1cbc00cd1e552336dceb790"
|
||||||
|
|
Loading…
Reference in New Issue