Skip to content

Commit

Permalink
minor ts cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
sreuland committed Apr 27, 2023
1 parent 5599b9a commit d4a7dca
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 49 deletions.
2 changes: 1 addition & 1 deletion packages/connect-button/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"./src/global.d.ts"],
"compilerOptions": {
"jsx": "react",
"outDir": "./dist",
"outDir": "./dist"
}
}
4 changes: 2 additions & 2 deletions packages/events/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
"/dist"
],
"dependencies": {
"@soroban-react/core": "./packages/core",
"@soroban-react/types": "./packages/types",
"@soroban-react/core": "^4.1.0",
"@soroban-react/types": "^4.0.0",
"soroban-client": "https://github.com/stellar/js-soroban-client#main"
},
"devDependencies": {
Expand Down
10 changes: 5 additions & 5 deletions packages/events/src/SorobanEventsProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, {useEffect, useRef} from 'react';
import * as SorobanClient from 'soroban-client';
import { useSorobanReact, SorobanContextType } from '@soroban-react/core';
import { SorobanEventsContext, DefaultSorobanEventsContext} from "./SorobanEventsContext";;
import React, {useEffect, useRef} from "react";
import * as SorobanClient from "soroban-client";
import { useSorobanReact, SorobanContextType } from "@soroban-react/core";
import { SorobanEventsContext, DefaultSorobanEventsContext} from "./SorobanEventsContext";
let xdr = SorobanClient.xdr

export interface SorobanEventsProviderProps {
Expand All @@ -12,7 +12,7 @@ export function SorobanEventsProvider({
children,
}: SorobanEventsProviderProps) {
const pollInterval = 5000
const sorobanContext = useSorobanReact()
const sorobanContext: SorobanContextType = useSorobanReact()

useEffect(() => {
let timeoutId: NodeJS.Timer | null = null
Expand Down
4 changes: 2 additions & 2 deletions packages/events/src/useSorobanEvents.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { useContext, Context } from 'react';
import React, { useContext, Context } from "react";
import { SorobanEventsContext, SorobanEventsContextType } from "./SorobanEventsContext";

export function useSorobanEvents() {
const context = useContext(SorobanEventsContext as Context<SorobanEventsContextType | undefined>)
if (!context) throw Error('useWeb3React can only be used within the Web3ReactProvider component')
if (!context) throw Error('useSorobanEvents can only be used within the SorobanEventsProvider component')
return context
}
94 changes: 55 additions & 39 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -583,16 +583,6 @@
resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.25.24.tgz#8c7688559979f7079aacaf31aa881c3aa410b718"
integrity sha512-XJfwUVUKDHF5ugKwIcxEgc9k8b7HbznCp6eUfWgu710hMPNIO4aw4/zB5RogDQz8nd6gyCDpU9O/m6qYEWY6yQ==

"@soroban-react/core@./packages/core":
version "4.1.0"
dependencies:
"@soroban-react/freighter" "^4.0.0"
"@soroban-react/types" "^4.0.0"
soroban-client "https://github.com/stellar/js-soroban-client#main"

"@soroban-react/types@./packages/types":
version "4.0.0"

"@stellar/freighter-api@^1.3.1":
version "1.4.0"
resolved "https://registry.yarnpkg.com/@stellar/freighter-api/-/freighter-api-1.4.0.tgz#f53ab58792733caa1fe33d60050ec24164e331f3"
Expand Down Expand Up @@ -1757,11 +1747,11 @@ fs-minipass@^2.0.0, fs-minipass@^2.1.0:
minipass "^3.0.0"

fs-minipass@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-3.0.1.tgz#853809af15b6d03e27638d1ab6432e6b378b085d"
integrity sha512-MhaJDcFRTuLidHrIttu0RDGyyXs/IYHVmlcxfLAEFIWjc1vdLAkdwT7Ace2u7DbitWC0toKMl5eJZRYNVreIMw==
version "3.0.2"
resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-3.0.2.tgz#5b383858efa8c1eb8c33b39e994f7e8555b8b3a3"
integrity sha512-2GAfyfoaCDRrM6jaOS3UsBts8yJ55VioXdWcOL7dK9zdAuKT71+WBA4ifnNYqVjYv+4SsPxjK0JT4yIIn4cA/g==
dependencies:
minipass "^4.0.0"
minipass "^5.0.0"

fs.realpath@^1.0.0:
version "1.0.0"
Expand All @@ -1788,15 +1778,15 @@ gauge@^4.0.3:
wide-align "^1.1.5"

gauge@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/gauge/-/gauge-5.0.0.tgz#e270ca9d97dae84abf64e5277ef1ebddc7dd1e2f"
integrity sha512-0s5T5eciEG7Q3ugkxAkFtaDhrrhXsCRivA5y8C9WMHWuI8UlMOJg7+Iwf7Mccii+Dfs3H5jHepU0joPVyQU0Lw==
version "5.0.1"
resolved "https://registry.yarnpkg.com/gauge/-/gauge-5.0.1.tgz#1efc801b8ff076b86ef3e9a7a280a975df572112"
integrity sha512-CmykPMJGuNan/3S4kZOpvvPYSNqSHANiWnh9XcMU2pSjtBfF0XzZ2p1bFAxTbnFxyBuPxQYHhzwaoOmUdqzvxQ==
dependencies:
aproba "^1.0.3 || ^2.0.0"
color-support "^1.1.3"
console-control-strings "^1.1.0"
has-unicode "^2.0.1"
signal-exit "^3.0.7"
signal-exit "^4.0.1"
string-width "^4.2.3"
strip-ansi "^6.0.1"
wide-align "^1.1.5"
Expand Down Expand Up @@ -2087,11 +2077,11 @@ ignore-walk@^5.0.1:
minimatch "^5.0.1"

ignore-walk@^6.0.0:
version "6.0.2"
resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-6.0.2.tgz#c48f48397cf8ef6174fcc28aa5f8c1de6203d389"
integrity sha512-ezmQ1Dg2b3jVZh2Dh+ar6Eu2MqNSTkyb32HU2MAQQQX9tKM3q/UQ/9lf03lQ5hW+fOeoMnwxwkleZ0xcNp0/qg==
version "6.0.3"
resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-6.0.3.tgz#0fcdb6decaccda35e308a7b0948645dd9523b7bb"
integrity sha512-C7FfFoTA+bI10qfeydT8aZbvr91vAEU+2W5BZUlzPec47oNb07SsOfwYrtxuvOYdUApPP/Qlh4DtAO51Ekk2QA==
dependencies:
minimatch "^7.4.2"
minimatch "^9.0.0"

ignore@^5.0.4, ignore@^5.2.0:
version "5.2.4"
Expand Down Expand Up @@ -2356,7 +2346,7 @@ jake@^10.8.5:
filelist "^1.0.1"
minimatch "^3.0.4"

js-tokens@^4.0.0:
"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==
Expand Down Expand Up @@ -2626,6 +2616,13 @@ long@^2.2.3:
resolved "https://registry.yarnpkg.com/long/-/long-2.4.0.tgz#9fa180bb1d9500cdc29c4156766a1995e1f4524f"
integrity sha512-ijUtjmO/n2A5PaosNG9ZGDsQ3vxJg7ZW8vsY8Kp0f2yIZWhSJvjmegV7t+9RPQKxKrvj8yKGehhS+po14hPLGQ==

loose-envify@^1.1.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf"
integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==
dependencies:
js-tokens "^3.0.0 || ^4.0.0"

lru-cache@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94"
Expand Down Expand Up @@ -2810,6 +2807,13 @@ minimatch@^8.0.2:
dependencies:
brace-expansion "^2.0.1"

minimatch@^9.0.0:
version "9.0.0"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.0.tgz#bfc8e88a1c40ffd40c172ddac3decb8451503b56"
integrity sha512-0jJj8AvgKqWN05mrwuqi8QYKx1WmYSUoKSxu5Qhs9prezTz10sxAHGNZe9J9cqIJzta8DWsleh2KaVaLl6Ru2w==
dependencies:
brace-expansion "^2.0.1"

minimist-options@4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/minimist-options/-/minimist-options-4.1.0.tgz#c0655713c53a8a2ebd77ffa247d342c40f010619"
Expand Down Expand Up @@ -2843,11 +2847,11 @@ minipass-fetch@^2.0.3:
encoding "^0.1.13"

minipass-fetch@^3.0.0:
version "3.0.2"
resolved "https://registry.yarnpkg.com/minipass-fetch/-/minipass-fetch-3.0.2.tgz#2f7275ae13f2fb0f2a469cee4f78250c25c80ab3"
integrity sha512-/ZpF1CQaWYqjbhfFgKNt3azxztEpc/JUPuMkqOgrnMQqcU8CbE409AUdJYTIWryl3PP5CBaTJZT71N49MXP/YA==
version "3.0.3"
resolved "https://registry.yarnpkg.com/minipass-fetch/-/minipass-fetch-3.0.3.tgz#d9df70085609864331b533c960fd4ffaa78d15ce"
integrity sha512-n5ITsTkDqYkYJZjcRWzZt9qnZKCT7nKCosJhHoj7S7zD+BP4jVbWs+odsniw5TA3E0sLomhTKOKjF86wf11PuQ==
dependencies:
minipass "^4.0.0"
minipass "^5.0.0"
minipass-sized "^1.0.3"
minizlib "^2.1.2"
optionalDependencies:
Expand Down Expand Up @@ -3721,6 +3725,13 @@ react-is@^18.0.0:
resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.2.0.tgz#199431eeaaa2e09f86427efbb4f1473edb47609b"
integrity sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==

react@>=16.8:
version "18.2.0"
resolved "https://registry.yarnpkg.com/react/-/react-18.2.0.tgz#555bd98592883255fa00de14f1151a917b5d77d5"
integrity sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==
dependencies:
loose-envify "^1.1.0"

read-cmd-shim@3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/read-cmd-shim/-/read-cmd-shim-3.0.0.tgz#62b8c638225c61e6cc607f8f4b779f3b8238f155"
Expand Down Expand Up @@ -3936,9 +3947,9 @@ run-parallel@^1.1.9:
queue-microtask "^1.2.2"

rxjs@^7.5.5:
version "7.8.0"
resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.8.0.tgz#90a938862a82888ff4c7359811a595e14e1e09a4"
integrity sha512-F2+gxDshqmIub1KdvZkaEfGDwLNpPvk9Fs6LD/MyQxNgMds/WH9OdDDXOmxUZpME+iSK3rQCctkL0DYyytUqMg==
version "7.8.1"
resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.8.1.tgz#6f6f3d99ea8044291efd92e7c7fcf562c4057543"
integrity sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==
dependencies:
tslib "^2.1.0"

Expand Down Expand Up @@ -4025,6 +4036,11 @@ signal-exit@3.0.7, signal-exit@^3.0.2, signal-exit@^3.0.3, signal-exit@^3.0.7:
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9"
integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==

signal-exit@^4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-4.0.1.tgz#96a61033896120ec9335d96851d902cc98f0ba2a"
integrity sha512-uUWsN4aOxJAS8KOuf3QMyFtgm1pkb6I+KRZbRF/ghdf5T7sM+B1lLLzPDxswUjkmHyxQAVzEgG35E3NzDM9GVw==

sigstore@^1.3.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/sigstore/-/sigstore-1.4.0.tgz#2e3a28c08b1b8246744c27cfb179c525c3f164d8"
Expand Down Expand Up @@ -4070,7 +4086,7 @@ sodium-native@^3.3.0:

soroban-client@^0.5.0, "soroban-client@https://github.com/stellar/js-soroban-client#main":
version "0.5.0"
resolved "https://github.com/stellar/js-soroban-client#8c71ada589bb9daa5d7afa8e63655d32627b2bac"
resolved "https://github.com/stellar/js-soroban-client#a52897f24a5b70e39a822c296a0dc2ab2959d713"
dependencies:
"@types/eventsource" "^1.1.2"
"@types/node" "18.11.9"
Expand Down Expand Up @@ -4147,11 +4163,11 @@ ssri@9.0.1, ssri@^9.0.0:
minipass "^3.1.1"

ssri@^10.0.0, ssri@^10.0.1:
version "10.0.3"
resolved "https://registry.yarnpkg.com/ssri/-/ssri-10.0.3.tgz#7f83da39058ca1d599d174e9eee4237659710bf4"
integrity sha512-lJtX/BFPI/VEtxZmLfeh7pzisIs6micwZ3eruD3+ds9aPsXKlYpwDS2Q7omD6WC42WO9+bnUSzlMmfv8uK8meg==
version "10.0.4"
resolved "https://registry.yarnpkg.com/ssri/-/ssri-10.0.4.tgz#5a20af378be586df139ddb2dfb3bf992cf0daba6"
integrity sha512-12+IR2CB2C28MMAw0Ncqwj5QbTcs0nGIhgJzYWzDkb21vWmfNI83KS4f3Ci6GI98WreIfG7o9UXp3C0qbpA8nQ==
dependencies:
minipass "^4.0.0"
minipass "^5.0.0"

stellar-base@8.2.2-soroban.12:
version "8.2.2-soroban.12"
Expand Down Expand Up @@ -4619,12 +4635,12 @@ write-file-atomic@^2.4.2:
signal-exit "^3.0.2"

write-file-atomic@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-5.0.0.tgz#54303f117e109bf3d540261125c8ea5a7320fab0"
integrity sha512-R7NYMnHSlV42K54lwY9lvW6MnSm1HSJqZL3xiSgi9E7//FYaI74r2G0rd+/X6VAMkHEdzxQaU5HUOXWUz5kA/w==
version "5.0.1"
resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-5.0.1.tgz#68df4717c55c6fa4281a7860b4c2ba0a6d2b11e7"
integrity sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==
dependencies:
imurmurhash "^0.1.4"
signal-exit "^3.0.7"
signal-exit "^4.0.1"

write-json-file@^3.2.0:
version "3.2.0"
Expand Down

0 comments on commit d4a7dca

Please sign in to comment.