Skip to content

Commit

Permalink
fix: upgrade to js-sdk v3.1.0 (#2916)
Browse files Browse the repository at this point in the history
* fix: swaps status

* fix: update js-sdk

* fix: upgrade to sdk v3.1
  • Loading branch information
reneaaron authored Dec 18, 2023
1 parent 31fb871 commit 5992f78
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 14 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"dependencies": {
"@bitcoin-design/bitcoin-icons-react": "^0.1.10",
"@bitcoinerlab/secp256k1": "^1.0.5",
"@getalby/sdk": "^2.6.0",
"@getalby/sdk": "^3.1.0",
"@headlessui/react": "^1.7.16",
"@lightninglabs/lnc-web": "^0.2.4-alpha",
"@noble/curves": "^1.1.0",
Expand Down
3 changes: 3 additions & 0 deletions src/app/screens/SendToBitcoinAddress/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ function SendToBitcoinAddress() {
setFeesLoading(true);

const result = await api.getSwapInfo();
if (!result.available) {
throw new Error("Swaps currently not available");
}

setServiceFeePercentage(result.service_fee_percentage);
setSatsPerVbyte(result.sats_per_vbyte);
Expand Down
4 changes: 2 additions & 2 deletions src/extension/background-script/connectors/alby.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export default class Alby implements Connector {
custom_records: invoice.custom_records,
id: `${invoice.payment_request}-${index}`,
memo: invoice.comment || invoice.memo,
preimage: invoice.preimage,
preimage: invoice.preimage ?? "",
payment_hash: invoice.payment_hash,
settled: invoice.settled,
settleDate: new Date(invoice.settled_at).getTime(),
Expand Down Expand Up @@ -291,7 +291,7 @@ export default class Alby implements Connector {
}
}

let authUrl = authClient.generateAuthURL({
let authUrl = await authClient.generateAuthURL({
code_challenge_method: "S256",
authorizeUrl: process.env.ALBY_OAUTH_AUTHORIZE_URL,
});
Expand Down
27 changes: 16 additions & 11 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -666,14 +666,13 @@
resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.52.0.tgz#78fe5f117840f69dc4a353adf9b9cd926353378c"
integrity sha512-mjZVbpaeMZludF2fsWLD0Z9gCref1Tk4i9+wddjRvpUNqqcndPkBD09N/Mapey0b3jaXbLm2kICwFv2E64QinA==

"@getalby/sdk@^2.6.0":
version "2.6.0"
resolved "https://registry.yarnpkg.com/@getalby/sdk/-/sdk-2.6.0.tgz#51508c7833b0580575055f15b8fe21567b76288a"
integrity sha512-klD1FrpGY39QldPf00KtzIveWj0dXtgGdZH6nLWdJ0Ness7FAqy2RkgSF7JQfKJeJSFek7Ip3AL/KCT5/lZgww==
"@getalby/sdk@^3.1.0":
version "3.1.0"
resolved "https://registry.yarnpkg.com/@getalby/sdk/-/sdk-3.1.0.tgz#49a6d7b292f3c6ab1c37e72422aa0f0ec8f43226"
integrity sha512-1WwwMfrCRtlUv3BnT/rqYiE5giztH5ZxfT1fDwhaJGeC8EJXxGjFBbaUhE0Wq98Fcs/hKoGM4gSmp3UHFDuQxg==
dependencies:
crypto-js "^4.1.1"
events "^3.3.0"
nostr-tools "1.13.1"
nostr-tools "^1.17.0"

"@headlessui/react@^1.7.16":
version "1.7.16"
Expand Down Expand Up @@ -1053,6 +1052,11 @@
strict-event-emitter "^0.2.4"
web-encoding "^1.1.5"

"@noble/ciphers@0.2.0":
version "0.2.0"
resolved "https://registry.yarnpkg.com/@noble/ciphers/-/ciphers-0.2.0.tgz#a12cda60f3cf1ab5d7c77068c3711d2366649ed7"
integrity sha512-6YBxJDAapHSdd3bLDv6x2wRPwq4QFMUaB3HvljNBUTThDd12eSm7/3F+2lnfzx2jvM+S6Nsy0jEt9QbPqSwqRw==

"@noble/curves@1.1.0", "@noble/curves@^1.1.0", "@noble/curves@~1.1.0":
version "1.1.0"
resolved "https://registry.npmjs.org/@noble/curves/-/curves-1.1.0.tgz"
Expand Down Expand Up @@ -3482,7 +3486,7 @@ cross-spawn@^7.0.2, cross-spawn@^7.0.3:
shebang-command "^2.0.0"
which "^2.0.1"

crypto-js@4.1.1, crypto-js@^4.1.1:
crypto-js@4.1.1:
version "4.1.1"
resolved "https://registry.npmjs.org/crypto-js/-/crypto-js-4.1.1.tgz"
integrity sha512-o2JlM7ydqd3Qk9CA0L4NL6mTzU2sdx96a+oOfPu8Mkl/PK51vSyoi8/rQ8NknZtk44vq15lmhAj9CIAGwgeWKw==
Expand Down Expand Up @@ -7147,11 +7151,12 @@ normalize-range@^0.1.2:
resolved "https://registry.npmjs.org/normalize-range/-/normalize-range-0.1.2.tgz"
integrity "sha1-LRDAa9/TEuqXd2laTShDlFa3WUI= sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA=="

nostr-tools@1.13.1:
version "1.13.1"
resolved "https://registry.npmjs.org/nostr-tools/-/nostr-tools-1.13.1.tgz"
integrity sha512-DTwpbxTH1/ar+afWd4gmVdpHH8CF290kdaxi00Llra88SHE6e38XuyzlRABVTcrBaceLMnoDdHmV3x16MoEFJg==
nostr-tools@^1.17.0:
version "1.17.0"
resolved "https://registry.yarnpkg.com/nostr-tools/-/nostr-tools-1.17.0.tgz#b6f62e32fedfd9e68ec0a7ce57f74c44fc768e8c"
integrity sha512-LZmR8GEWKZeElbFV5Xte75dOeE9EFUW/QLI1Ncn3JKn0kFddDKEfBbFN8Mu4TMs+L4HR/WTPha2l+PPuRnJcMw==
dependencies:
"@noble/ciphers" "0.2.0"
"@noble/curves" "1.1.0"
"@noble/hashes" "1.3.1"
"@scure/base" "1.1.1"
Expand Down

0 comments on commit 5992f78

Please sign in to comment.