Skip to content

Hot Wallet Integration #279

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 2 additions & 3 deletions stellar/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@
"build": "next build",
"start": "next start",
"lint": "next lint",
"prepare": "husky install",
"format": "prettier --write .",
"prettier-check": "prettier --check ."
},
"dependencies": {
"@creit.tech/stellar-wallets-kit": "^1.2.0",
"@creit.tech/stellar-wallets-kit": "1.7.1",
"@livepeer/react": "^4.2.2",
"@near-wallet-selector/bitget-wallet": "^8.9.13",
"@near-wallet-selector/bitte-wallet": "^8.9.13",
Expand Down Expand Up @@ -65,7 +64,7 @@
"react-timer-hook": "^3.0.7",
"react-tooltip": "^5.28.0",
"round-client": "./round-client",
"rxjs": "^7.8.1",
"rxjs": "7.8.1",
"swr": "^2.2.5",
"tus-js-client": "^4.1.0",
"zod": "^3.23.8",
Expand Down
55 changes: 28 additions & 27 deletions stellar/frontend/src/app/components/pages/application/Rounds.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ const ApplicationRoundsItem = ({
if (selectedRoundType === 'upcoming') {
if (
new Date().getTime() >=
new Date(doc.application_start || '').getTime() &&
new Date(doc.application_start || '').getTime() &&
new Date().getTime() < new Date(doc.application_end || '').getTime()
) {
return `upcoming-open`
Expand Down Expand Up @@ -244,8 +244,8 @@ const ApplicationRoundsItem = ({
getSpecificTime() === 'on-going'
? `border-grantpicks-green-400 text-grantpicks-green-700 bg-grantpicks-green-50`
: getSpecificTime() === 'upcoming' ||
getSpecificTime() === 'upcoming-closed' ||
getSpecificTime() == 'ended'
getSpecificTime() === 'upcoming-closed' ||
getSpecificTime() == 'ended'
? `border-grantpicks-black-400 text-grantpicks-black-950 bg-grantpicks-black-50`
: `border-grantpicks-amber-400 text-grantpicks-amber-700 bg-grantpicks-amber-50`,
)}
Expand All @@ -255,7 +255,7 @@ const ApplicationRoundsItem = ({
) : getSpecificTime() === 'upcoming-open' ? (
<IconProject size={18} className="fill-grantpicks-green-400" />
) : getSpecificTime() === 'upcoming' ||
getSpecificTime() === 'upcoming-closed' ? (
getSpecificTime() === 'upcoming-closed' ? (
<IconProject size={18} className="fill-grantpicks-black-950" />
) : getSpecificTime() === 'ended' ? (
<IconDollar size={18} className="fill-grantpicks-black-950" />
Expand Down Expand Up @@ -420,29 +420,29 @@ const ApplicationRoundsItem = ({
getSpecificTime() === 'upcoming' ||
getSpecificTime() === 'upcoming-open' ||
getSpecificTime() === 'upcoming-closed') && (
<div className="mt-6">
<RoundMenu
data={doc}
onViewDetails={() => {
setShowDetailDrawer(true)
router.push(
`?round_type=${selectedRoundType}&round_id=${doc.on_chain_id}`,
{ scroll: false },
)
}}
onViewApps={() => {
setShowAppsDrawer(true)
}}
onFundRound={() => {
if (!connectedWallet) {
setShowMenu('choose-wallet')
return
}
setShowFundRoundModal(true)
}}
/>
</div>
)}
<div className="mt-6">
<RoundMenu
data={doc}
onViewDetails={() => {
setShowDetailDrawer(true)
router.push(
`?round_type=${selectedRoundType}&round_id=${doc.on_chain_id}`,
{ scroll: false },
)
}}
onViewApps={() => {
setShowAppsDrawer(true)
}}
onFundRound={() => {
if (!connectedWallet) {
setShowMenu('choose-wallet')
return
}
setShowFundRoundModal(true)
}}
/>
</div>
)}

<RoundDetailDrawer
isOpen={showDetailDrawer}
Expand Down Expand Up @@ -551,6 +551,7 @@ const ApplicationRounds = () => {
useSWRInfinite(getKey, async (key) => await onFetchRounds(key), {
revalidateFirstPage: false,
})

const rounds = data
? ([] as GPRound[]).concat(...(data as any as GPRound[]))
: []
Expand Down
7 changes: 5 additions & 2 deletions stellar/frontend/src/app/providers/WalletProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import {
LobstrModule,
HanaModule,
ISupportedWallet,
HotWalletModule,
StellarWalletsKit,
WalletNetwork,
} from '@creit.tech/stellar-wallets-kit'
Expand Down Expand Up @@ -142,6 +143,7 @@ const WalletProvider = ({ children }: { children: React.ReactNode }) => {
modules: [
new FreighterModule(),
new xBullModule(),
new HotWalletModule(),
new LobstrModule(),
new HanaModule(),
],
Expand Down Expand Up @@ -187,7 +189,8 @@ const WalletProvider = ({ children }: { children: React.ReactNode }) => {

return
} else if (kit && localStellarPubKey) {
const pubKey = (await kit?.getAddress()).address
// console.log(kit)
const { address: pubKey } = await kit.getAddress()
setConnectedWallet('stellar')
localStorage.setItem(localStorageConfigs.CONNECTED_WALLET, 'stellar')
setStellarPubKey(localStellarPubKey || pubKey)
Expand Down Expand Up @@ -235,7 +238,7 @@ const WalletProvider = ({ children }: { children: React.ReactNode }) => {
localStorageConfigs.LAST_STELLAR_WALLET_ID,
option.id,
)
const pubKey = (await stellarKit?.getAddress()).address
const { address: pubKey } = await stellarKit?.getAddress()
setConnectedWallet('stellar')
localStorage.setItem(localStorageConfigs.CONNECTED_WALLET, 'stellar')
setStellarPubKey(pubKey)
Expand Down
Loading