Skip to content

Commit 1b5bc51

Browse files
committed
Protocol version moved to 1
1 parent 610e9ed commit 1b5bc51

5 files changed

Lines changed: 12 additions & 21 deletions

File tree

PROTOCOL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ The expected payload shape (after verifying the JWS) is:
152152

153153
```json
154154
{
155-
"version": 0,
155+
"version": 1,
156156
"ticker": "xmr",
157157
"address": "...",
158158
"expires": "2026-01-25T15:37:49Z",

clients/testdata/jws.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
"expires": "2099-01-01T00:00:00Z",
1111
"nonce": "test-nonce",
1212
"ticker": "xmr",
13-
"version": 0
13+
"version": 1
1414
}
1515
}

internal/cryptalias/handlers.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,10 @@ func WellKnownHandler(store *ConfigStore) http.HandlerFunc {
3636
}
3737

3838
d := WalletDomain{
39-
Version: VERSION,
40-
Domain: domain.Domain,
41-
PublicKey: key,
42-
ResolverMode: AliasResolverModeDelegated,
43-
Resolver: AliasResolver{ResolverEndpoint: c.BaseURL},
39+
Version: VERSION,
40+
Domain: domain.Domain,
41+
PublicKey: key,
42+
Resolver: AliasResolver{ResolverEndpoint: c.BaseURL},
4443
}
4544

4645
w.WriteHeader(http.StatusOK)

internal/cryptalias/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"time"
1010
)
1111

12-
const VERSION = 0
12+
const VERSION = 1
1313

1414
var defaultConfig = &Config{
1515
BaseURL: "http://127.0.0.1:8080",

internal/cryptalias/types.go

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,6 @@ type AliasResolver struct {
1010
ResolverEndpoint string `json:"resolver_endpoint"`
1111
}
1212

13-
type AliasResolverMode string
14-
15-
const (
16-
AliasResolverModeDelegated AliasResolverMode = "delegated"
17-
AliasResolverModeStatic AliasResolverMode = "static"
18-
)
19-
2013
type WalletAddress struct {
2114
Ticker string `json:"ticker" yaml:"ticker"`
2215
Address string `json:"address" yaml:"address"`
@@ -39,12 +32,11 @@ type WalletTag struct {
3932
}
4033

4134
type WalletDomain struct {
42-
Version uint `json:"version"`
43-
ResolverMode AliasResolverMode `json:"resolver_mode"`
44-
Resolver AliasResolver `json:"resolver"`
45-
Domain string `json:"domain"`
46-
PublicKey jwk.Key `json:"key"`
47-
Aliases []WalletAlias `json:"aliases,omitempty"`
35+
Version uint `json:"version"`
36+
Resolver AliasResolver `json:"resolver"`
37+
Domain string `json:"domain"`
38+
PublicKey jwk.Key `json:"key"`
39+
Aliases []WalletAlias `json:"aliases,omitempty"`
4840
}
4941

5042
type ResolvedAddress struct {

0 commit comments

Comments
 (0)