-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
integrate alldomains to helium wallet:
* add TldParser to retrieve domain owner * add debounce to avoid unneccessary rpc calls * add alias/nickname as the domain when applicable
- Loading branch information
1 parent
58da0f0
commit e846a09
Showing
6 changed files
with
99 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { TldParser } from '@onsol/tldparser' | ||
import { Connection } from '@solana/web3.js' | ||
|
||
// retrives AllDomain domain owner. | ||
// the domain must include the dot | ||
export async function fetchDomainOwner(connection: Connection, domain: string) { | ||
try { | ||
const parser = new TldParser(connection) | ||
const owner = await parser.getOwnerFromDomainTld(domain) | ||
if (!owner) return | ||
return owner.toBase58() | ||
} catch (e) { | ||
// Handle the error here if needed | ||
// console.error("Error fetching domain owner:", e); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters