@@ -25,9 +25,9 @@ import (
2525
2626// Client lets you discover who others are, and let the world know who you are.
2727type Client struct {
28- wallet wallet.Interface
29- options IdentityClientOptions
30- originator OriginatorDomainNameStringUnder250Bytes
28+ Wallet wallet.Interface
29+ Options IdentityClientOptions
30+ Originator OriginatorDomainNameStringUnder250Bytes
3131}
3232
3333// NewClient creates a new IdentityClient with the provided wallet and options
@@ -57,9 +57,9 @@ func NewClient(w wallet.Interface, options *IdentityClientOptions, originator Or
5757 }
5858
5959 return & Client {
60- wallet : w ,
61- options : * options ,
62- originator : originator ,
60+ Wallet : w ,
61+ Options : * options ,
62+ Originator : originator ,
6363 }, nil
6464}
6565
@@ -107,11 +107,11 @@ func (c *Client) PubliclyRevealAttributes(
107107 }
108108
109109 // Get keyring for verifier through certificate proving
110- proveResult , err := c .wallet .ProveCertificate (ctx , wallet.ProveCertificateArgs {
110+ proveResult , err := c .Wallet .ProveCertificate (ctx , wallet.ProveCertificateArgs {
111111 Certificate : * certificate ,
112112 FieldsToReveal : fieldNamesAsStrings ,
113113 Verifier : dummyPk .PubKey (),
114- }, string (c .originator ))
114+ }, string (c .Originator ))
115115 if err != nil {
116116 return nil , nil , fmt .Errorf ("failed to prove certificate: %w" , err )
117117 }
@@ -141,16 +141,16 @@ func (c *Client) PubliclyRevealAttributes(
141141
142142 // Create PushDrop with the certificate data
143143 pushDropTemplate := & pushdrop.PushDropTemplate {
144- Wallet : c .wallet ,
145- Originator : string (c .originator ),
144+ Wallet : c .Wallet ,
145+ Originator : string (c .Originator ),
146146 }
147147
148148 // Create locking script using PushDrop with the certificate JSON
149149 lockingScript , err := pushDropTemplate .Lock (
150150 ctx ,
151151 [][]byte {certJSON },
152- c .options .ProtocolID ,
153- c .options .KeyID ,
152+ c .Options .ProtocolID ,
153+ c .Options .KeyID ,
154154 wallet.Counterparty {Type : wallet .CounterpartyTypeAnyone },
155155 true ,
156156 true ,
@@ -161,19 +161,19 @@ func (c *Client) PubliclyRevealAttributes(
161161 }
162162
163163 // Create a transaction with the certificate as an output
164- createResult , err := c .wallet .CreateAction (ctx , wallet.CreateActionArgs {
164+ createResult , err := c .Wallet .CreateAction (ctx , wallet.CreateActionArgs {
165165 Description : "Create a new Identity Token" ,
166166 Outputs : []wallet.CreateActionOutput {
167167 {
168- Satoshis : c .options .TokenAmount ,
168+ Satoshis : c .Options .TokenAmount ,
169169 LockingScript : lockingScript .Bytes (),
170170 OutputDescription : "Identity Token" ,
171171 },
172172 },
173173 Options : & wallet.CreateActionOptions {
174174 RandomizeOutputs : util .BoolPtr (false ),
175175 },
176- }, string (c .originator ))
176+ }, string (c .Originator ))
177177 if err != nil {
178178 return nil , nil , fmt .Errorf ("failed to create action: %w" , err )
179179 }
@@ -189,7 +189,7 @@ func (c *Client) PubliclyRevealAttributes(
189189 }
190190
191191 // Submit the transaction to an overlay
192- networkResult , err := c .wallet .GetNetwork (ctx , nil , string (c .originator ))
192+ networkResult , err := c .Wallet .GetNetwork (ctx , nil , string (c .Originator ))
193193 if err != nil {
194194 return nil , nil , fmt .Errorf ("failed to get network: %w" , err )
195195 }
@@ -242,7 +242,7 @@ func (c *Client) ResolveByIdentityKey(
242242 ctx context.Context ,
243243 args wallet.DiscoverByIdentityKeyArgs ,
244244) ([]DisplayableIdentity , error ) {
245- result , err := c .wallet .DiscoverByIdentityKey (ctx , args , string (c .originator ))
245+ result , err := c .Wallet .DiscoverByIdentityKey (ctx , args , string (c .Originator ))
246246 if err != nil {
247247 return nil , err
248248 }
@@ -260,7 +260,7 @@ func (c *Client) ResolveByAttributes(
260260 ctx context.Context ,
261261 args wallet.DiscoverByAttributesArgs ,
262262) ([]DisplayableIdentity , error ) {
263- result , err := c .wallet .DiscoverByAttributes (ctx , args , string (c .originator ))
263+ result , err := c .Wallet .DiscoverByAttributes (ctx , args , string (c .Originator ))
264264 if err != nil {
265265 return nil , err
266266 }
@@ -284,42 +284,42 @@ func (c *Client) parseIdentity(identity *wallet.IdentityCertificate) Displayable
284284 avatarURL = identity .DecryptedFields ["profilePhoto" ]
285285 badgeLabel = fmt .Sprintf ("X account certified by %s" , identity .CertifierInfo .Name )
286286 badgeIconURL = identity .CertifierInfo .IconUrl
287- badgeClickURL = "https://socialcert.net" // TODO Make a specific page for this.
287+ badgeClickURL = "https://socialcert.net"
288288
289289 case KnownIdentityTypes .DiscordCert :
290290 name = identity .DecryptedFields ["userName" ]
291291 avatarURL = identity .DecryptedFields ["profilePhoto" ]
292292 badgeLabel = fmt .Sprintf ("Discord account certified by %s" , identity .CertifierInfo .Name )
293293 badgeIconURL = identity .CertifierInfo .IconUrl
294- badgeClickURL = "https://socialcert.net" // TODO Make a specific page for this.
294+ badgeClickURL = "https://socialcert.net"
295295
296296 case KnownIdentityTypes .EmailCert :
297297 name = identity .DecryptedFields ["email" ]
298298 avatarURL = "XUTZxep7BBghAJbSBwTjNfmcsDdRFs5EaGEgkESGSgjJVYgMEizu"
299299 badgeLabel = fmt .Sprintf ("Email certified by %s" , identity .CertifierInfo .Name )
300300 badgeIconURL = identity .CertifierInfo .IconUrl
301- badgeClickURL = "https://socialcert.net" // TODO Make a specific page for this.
301+ badgeClickURL = "https://socialcert.net"
302302
303303 case KnownIdentityTypes .PhoneCert :
304304 name = identity .DecryptedFields ["phoneNumber" ]
305305 avatarURL = "XUTLxtX3ELNUwRhLwL7kWNGbdnFM8WG2eSLv84J7654oH8HaJWrU"
306306 badgeLabel = fmt .Sprintf ("Phone certified by %s" , identity .CertifierInfo .Name )
307307 badgeIconURL = identity .CertifierInfo .IconUrl
308- badgeClickURL = "https://socialcert.net" // TODO Make a specific page for this.
308+ badgeClickURL = "https://socialcert.net"
309309
310310 case KnownIdentityTypes .IdentiCert :
311311 name = fmt .Sprintf ("%s %s" , identity .DecryptedFields ["firstName" ], identity .DecryptedFields ["lastName" ])
312312 avatarURL = identity .DecryptedFields ["profilePhoto" ]
313313 badgeLabel = fmt .Sprintf ("Government ID certified by %s" , identity .CertifierInfo .Name )
314314 badgeIconURL = identity .CertifierInfo .IconUrl
315- badgeClickURL = "https://identicert.me" // TODO Make a specific page for this.
315+ badgeClickURL = "https://identicert.me"
316316
317317 case KnownIdentityTypes .Registrant :
318318 name = identity .DecryptedFields ["name" ]
319319 avatarURL = identity .DecryptedFields ["icon" ]
320320 badgeLabel = fmt .Sprintf ("Entity certified by %s" , identity .CertifierInfo .Name )
321321 badgeIconURL = identity .CertifierInfo .IconUrl
322- badgeClickURL = "https://projectbabbage.com/docs/registrant" // TODO: Make this doc page exist
322+ badgeClickURL = "https://projectbabbage.com/docs/registrant"
323323
324324 case KnownIdentityTypes .CoolCert :
325325 if identity .DecryptedFields ["cool" ] == "true" {
@@ -333,14 +333,14 @@ func (c *Client) parseIdentity(identity *wallet.IdentityCertificate) Displayable
333333 avatarURL = "XUT4bpQ6cpBaXi1oMzZsXfpkWGbtp2JTUYAoN7PzhStFJ6wLfoeR"
334334 badgeLabel = "Represents the ability for anyone to access this information."
335335 badgeIconURL = "XUUV39HVPkpmMzYNTx7rpKzJvXfeiVyQWg2vfSpjBAuhunTCA9uG"
336- badgeClickURL = "https://projectbabbage.com/docs/anyone-identity" // TODO: Make this doc page exist
336+ badgeClickURL = "https://projectbabbage.com/docs/anyone-identity"
337337
338338 case KnownIdentityTypes .Self :
339339 name = "You"
340340 avatarURL = "XUT9jHGk2qace148jeCX5rDsMftkSGYKmigLwU2PLLBc7Hm63VYR"
341341 badgeLabel = "Represents your ability to access this information."
342342 badgeIconURL = "XUUV39HVPkpmMzYNTx7rpKzJvXfeiVyQWg2vfSpjBAuhunTCA9uG"
343- badgeClickURL = "https://projectbabbage.com/docs/self-identity" // TODO: Make this doc page exist
343+ badgeClickURL = "https://projectbabbage.com/docs/self-identity"
344344
345345 default :
346346 name = DefaultIdentity .Name
0 commit comments