You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// PaymentAddress returns a new Address with only the payment address portion. This will return nil for anything other than payment and script addresses
275
+
func (aAddress) PaymentAddress() *Address {
276
+
varaddrTypeuint8
277
+
ifa.addressType==AddressTypeKeyKey||
278
+
a.addressType==AddressTypeKeyNone {
279
+
addrType=AddressTypeKeyNone
280
+
} elseifa.addressType==AddressTypeScriptKey||
281
+
a.addressType==AddressTypeScriptNone||
282
+
a.addressType==AddressTypeScriptScript {
283
+
addrType=AddressTypeScriptNone
284
+
} else {
285
+
// Unsupported address type
286
+
returnnil
287
+
}
288
+
newAddr:=&Address{
289
+
addressType: addrType,
290
+
networkId: a.networkId,
291
+
paymentAddress: a.paymentAddress[:],
292
+
}
293
+
returnnewAddr
294
+
}
295
+
274
296
// StakeAddress returns a new Address with only the stake key portion. This will return nil if the address is not a payment/staking key pair
0 commit comments