Skip to content

Commit

Permalink
chore(resolver): docs updated (#3573)
Browse files Browse the repository at this point in the history
  • Loading branch information
stackchain authored Aug 29, 2024
1 parent 8f998bf commit dbdbaa6
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 15 deletions.
32 changes: 18 additions & 14 deletions packages/resolver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,39 +20,43 @@ or

There are two strategies supported to get a crypto address:

- **all**: Will attempt to resolve on all services.

Response: `[{nameServer: 'cns', address: string | null, error: Error instance | null}, {nameServer: 'unstoppable', address: string | null, error: Error instance | null}, {nameServer: 'handle', address: string | null, error: Error instance | null}]`

- **all**: Will attempt to resolve for all services.
- **first**: Will return the service that resolves first.

Response: `[{nameServer: 'cns' | 'unstoppable' | 'handle', address: string | null, error: Error instance | null}]`

## API Reference

- **`resolverApiMaker`**

Accepted arguments:

1. apiConfig: `{unstoppable: '<unstoppable api key>'}`
2. cslFactory: Cardano Serialization Library initiator
1. apiConfig: `{unstoppable: '<unstoppable api key>'}`
2. cslFactory: Cardano Serialization Library initiator

Returns: `getCardanoAddresses`


- **`getCardanoAddresses`**
- **`getCardanoAddresses`**

Accepted arguments:

1. resolve: `string`. Domain or handle to look for.
2. strategy: `all` | `first`
1. resolve: `string`. Domain or handle to look for.
2. strategy: `all` | `first`

Returns depending on the strategy selected:

All:

`[{nameServer: 'cns', address: string | null, error: Error instance | null}, {nameServer: 'unstoppable', address: string | null, error: Error instance | null}, {nameServer: 'handle', address: string | null, error: Error instance | null}]`
```typescript
[
{nameServer: 'cns', address: string | null, error: Error instance | null},
{nameServer: 'unstoppable', address: string | null, error: Error instance | null},
{nameServer: 'handle', address: string | null, error: Error instance | null}
]
```

First:

`[{nameServer: 'cns' | 'unstoppable' | 'handle', address: string | null, error: Error instance | null}]`
```typescript
[
{nameServer: 'cns' | 'unstoppable' | 'handle', address: string | null, error: Error instance | null}
]
```
8 changes: 7 additions & 1 deletion packages/resolver/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@
"resolver",
"browser",
"react",
"react-native"
"react-native",
"ada-handle",
"ada handle",
"cns",
"unstoppable domains",
"unstoppable-domains",
"domain"
],
"homepage": "https://github.com/Emurgo/yoroi/packages/resolver#readme",
"bugs": {
Expand Down

0 comments on commit dbdbaa6

Please sign in to comment.