https://github.com/dialectlabs/dart-solana-name-service
https://github.com/dialectlabs/dart-solana-name-service
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/dialectlabs/dart-solana-name-service
- Owner: dialectlabs
- License: apache-2.0
- Created: 2022-06-20T17:30:01.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-06-24T13:52:39.000Z (almost 4 years ago)
- Last Synced: 2024-04-28T01:10:20.351Z (about 2 years ago)
- Language: Dart
- Size: 28.3 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://twitter.com/saydialect)
[](https://discord.gg/cxtZVyrJ)
## Dart library for Bonfida SNS
This library is a partial dart implementation of Bonfida's SNS (Solana Name Service) protocol, specifically enabling the use of .sol domains in Flutter applications.
## Implementation
1. Find all Bonfida SNS name registration accounts for a given user
```dart
final List accounts = await findOwnedNameAccountsForUser(
publicKey: PublicKey, // user account to query
{ environment: SolanaEnvironment } // defaults to mainnnet
);
```
2. Return a given user's SNS domain name
```dart
final String name = await fetchSolanaNameServiceName(
publicKey: String, // user account to query as a string
{ environment: SolanaEnvironment } // defaults to mainnnet
);
```
3. Return a given user's favorite SNS domain name
```dart
final String name = await findFavoriteDomainName(
publicKey: PublicKey, // user account to query
{ environment: SolanaEnvironment } // defaults to mainnnet
);
```
4. Return an SNS domain name owner's public key
```dart
final PublicKey publicKey = await findAccountByName(
name: String, // SNS domain name
{ environment: SolanaEnvironment } // defaults to mainnnet
);
```
5. Return the SNS domain name associated with a given SNS name registration account
```dart
final String name = await performReverseLookup(
account: PublicKey, // SNS name registration account to query
{ environment: SolanaEnvironment } // defaults to mainnnet
);
```
## Further Help & Documentation
We will continue to update documentation as often as possible. But if you need help, feel free to reach out in our [Dialect Discord server](https://discord.gg/cxtZVyrJ).