mirror of
https://github.com/sonr-io/sonr.git
synced 2026-08-02 17:31:39 +00:00
feat: add Motr support
This commit is contained in:
@@ -2,13 +2,13 @@
|
||||
package dwn
|
||||
|
||||
type Config struct {
|
||||
Ipfs *IPFS `pkl:"ipfs" json:"ipfs,omitempty"`
|
||||
Ipfs *IPFS `pkl:"ipfs"`
|
||||
|
||||
Sonr *Sonr `pkl:"sonr" json:"sonr,omitempty"`
|
||||
Sonr *Sonr `pkl:"sonr"`
|
||||
|
||||
Motr *Motr `pkl:"motr" json:"motr,omitempty"`
|
||||
Motr *Motr `pkl:"motr"`
|
||||
|
||||
Schema *Schema `pkl:"schema" json:"schema,omitempty"`
|
||||
Schema *Schema `pkl:"schema"`
|
||||
|
||||
ProxyUrl string `pkl:"proxyUrl" json:"proxyUrl,omitempty"`
|
||||
ProxyUrl string `pkl:"proxyUrl"`
|
||||
}
|
||||
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
package dwn
|
||||
|
||||
type IPFS struct {
|
||||
ApiUrl string `pkl:"apiUrl" json:"apiUrl,omitempty"`
|
||||
ApiUrl string `pkl:"apiUrl"`
|
||||
|
||||
GatewayUrl string `pkl:"gatewayUrl" json:"gatewayUrl,omitempty"`
|
||||
GatewayUrl string `pkl:"gatewayUrl"`
|
||||
}
|
||||
|
||||
+3
-3
@@ -2,9 +2,9 @@
|
||||
package dwn
|
||||
|
||||
type Motr struct {
|
||||
Keyshare string `pkl:"keyshare" json:"keyshare,omitempty"`
|
||||
Keyshare string `pkl:"keyshare"`
|
||||
|
||||
Address string `pkl:"address" json:"address,omitempty"`
|
||||
Address string `pkl:"address"`
|
||||
|
||||
Origin string `pkl:"origin" json:"origin,omitempty"`
|
||||
Origin string `pkl:"origin"`
|
||||
}
|
||||
|
||||
@@ -4,19 +4,19 @@ package dwn
|
||||
type Schema struct {
|
||||
Version int `pkl:"version"`
|
||||
|
||||
Account string `pkl:"account" json:"account,omitempty"`
|
||||
Account string `pkl:"account"`
|
||||
|
||||
Asset string `pkl:"asset" json:"asset,omitempty"`
|
||||
Asset string `pkl:"asset"`
|
||||
|
||||
Chain string `pkl:"chain" json:"chain,omitempty"`
|
||||
Chain string `pkl:"chain"`
|
||||
|
||||
Credential string `pkl:"credential" json:"credential,omitempty"`
|
||||
Credential string `pkl:"credential"`
|
||||
|
||||
Jwk string `pkl:"jwk" json:"jwk,omitempty"`
|
||||
Jwk string `pkl:"jwk"`
|
||||
|
||||
Grant string `pkl:"grant" json:"grant,omitempty"`
|
||||
Grant string `pkl:"grant"`
|
||||
|
||||
Keyshare string `pkl:"keyshare" json:"keyshare,omitempty"`
|
||||
Keyshare string `pkl:"keyshare"`
|
||||
|
||||
Profile string `pkl:"profile" json:"profile,omitempty"`
|
||||
Profile string `pkl:"profile"`
|
||||
}
|
||||
|
||||
+5
-5
@@ -2,13 +2,13 @@
|
||||
package dwn
|
||||
|
||||
type Sonr struct {
|
||||
ApiUrl string `pkl:"apiUrl" json:"apiUrl,omitempty"`
|
||||
ApiUrl string `pkl:"apiUrl"`
|
||||
|
||||
GrpcUrl string `pkl:"grpcUrl" json:"grpcUrl,omitempty"`
|
||||
GrpcUrl string `pkl:"grpcUrl"`
|
||||
|
||||
RpcUrl string `pkl:"rpcUrl" json:"rpcUrl,omitempty"`
|
||||
RpcUrl string `pkl:"rpcUrl"`
|
||||
|
||||
WebSocketUrl string `pkl:"webSocketUrl" json:"webSocketUrl,omitempty"`
|
||||
WebSocketUrl string `pkl:"webSocketUrl"`
|
||||
|
||||
ChainId string `pkl:"chainId" json:"chainId,omitempty"`
|
||||
ChainId string `pkl:"chainId"`
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
amends "https://pkl.sh/DWN.pkl";
|
||||
|
||||
dwn = new Config {
|
||||
ipfs = new IPFS {
|
||||
apiUrl = "https://api.sonr-ipfs.land";
|
||||
gatewayUrl = "https://ipfs.sonr.land";
|
||||
};
|
||||
sonr = new Sonr {
|
||||
apiUrl = "https://api.sonr.land";
|
||||
grpcUrl = "https://grpc.sonr.land";
|
||||
rpcUrl = "https://rpc.sonr.land";
|
||||
webSocketUrl = "wss://rpc.sonr.land/ws";
|
||||
chainId = "sonr";
|
||||
};
|
||||
motr = new Motr {
|
||||
keyshare = JSON.parse(keyshare);
|
||||
address = address;
|
||||
origin = "sonr.id";
|
||||
};
|
||||
schema = new Schema {
|
||||
version = 1;
|
||||
account = "account";
|
||||
asset = "asset";
|
||||
chain = "chain";
|
||||
credential = "credential";
|
||||
jwk = "jwk";
|
||||
grant = "grant";
|
||||
keyshare = "keyshare";
|
||||
profile = "profile";
|
||||
};
|
||||
};
|
||||
@@ -6,7 +6,7 @@ type Feature struct {
|
||||
|
||||
Description string `pkl:"description"`
|
||||
|
||||
Icon string `pkl:"icon"`
|
||||
Icon *string `pkl:"icon"`
|
||||
|
||||
Image *Image `pkl:"image"`
|
||||
}
|
||||
|
||||
@@ -6,5 +6,5 @@ type Highlights struct {
|
||||
|
||||
Subheading string `pkl:"subheading"`
|
||||
|
||||
Highlights []*Highlight `pkl:"highlights"`
|
||||
Highlights []*Feature `pkl:"highlights"`
|
||||
}
|
||||
|
||||
@@ -3,16 +3,4 @@ package models
|
||||
|
||||
type Home struct {
|
||||
Hero *Hero `pkl:"hero"`
|
||||
|
||||
Highlights []*Highlight `pkl:"highlights"`
|
||||
|
||||
Features []*Features `pkl:"features"`
|
||||
|
||||
Bento *Bento `pkl:"bento"`
|
||||
|
||||
Lowlights []*Lowlights `pkl:"lowlights"`
|
||||
|
||||
CallToAction *CallToAction `pkl:"callToAction"`
|
||||
|
||||
Footer *Footer `pkl:"footer"`
|
||||
}
|
||||
|
||||
@@ -10,15 +10,9 @@ func init() {
|
||||
pkl.RegisterMapping("models#Button", Button{})
|
||||
pkl.RegisterMapping("models#Image", Image{})
|
||||
pkl.RegisterMapping("models#Stat", Stat{})
|
||||
pkl.RegisterMapping("models#Highlight", Highlight{})
|
||||
pkl.RegisterMapping("models#Features", Features{})
|
||||
pkl.RegisterMapping("models#Bento", Bento{})
|
||||
pkl.RegisterMapping("models#Lowlights", Lowlights{})
|
||||
pkl.RegisterMapping("models#CallToAction", CallToAction{})
|
||||
pkl.RegisterMapping("models#Footer", Footer{})
|
||||
pkl.RegisterMapping("models#SocialLink", SocialLink{})
|
||||
pkl.RegisterMapping("models#Link", Link{})
|
||||
pkl.RegisterMapping("models#Input", Input{})
|
||||
pkl.RegisterMapping("models#Link", Link{})
|
||||
pkl.RegisterMapping("models#SocialLink", SocialLink{})
|
||||
pkl.RegisterMapping("models#Feature", Feature{})
|
||||
pkl.RegisterMapping("models#Highlights", Highlights{})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user