Make satoshi amounts signed in socketio
This commit is contained in:
parent
af6de32165
commit
82c64ae947
@ -237,11 +237,11 @@ type txInputs struct {
|
|||||||
// ScriptAsm *string `json:"scriptAsm"`
|
// ScriptAsm *string `json:"scriptAsm"`
|
||||||
Sequence int64 `json:"sequence"`
|
Sequence int64 `json:"sequence"`
|
||||||
Address *string `json:"address"`
|
Address *string `json:"address"`
|
||||||
Satoshis uint64 `json:"satoshis"`
|
Satoshis int64 `json:"satoshis"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type txOutputs struct {
|
type txOutputs struct {
|
||||||
Satoshis uint64 `json:"satoshis"`
|
Satoshis int64 `json:"satoshis"`
|
||||||
Script *string `json:"script"`
|
Script *string `json:"script"`
|
||||||
// ScriptAsm *string `json:"scriptAsm"`
|
// ScriptAsm *string `json:"scriptAsm"`
|
||||||
SpentTxID *string `json:"spentTxId,omitempty"`
|
SpentTxID *string `json:"spentTxId,omitempty"`
|
||||||
@ -260,15 +260,15 @@ type resTx struct {
|
|||||||
Locktime int `json:"locktime,omitempty"`
|
Locktime int `json:"locktime,omitempty"`
|
||||||
// Size int `json:"size,omitempty"`
|
// Size int `json:"size,omitempty"`
|
||||||
Inputs []txInputs `json:"inputs"`
|
Inputs []txInputs `json:"inputs"`
|
||||||
// InputSatoshis uint64 `json:"inputSatoshis,omitempty"`
|
// InputSatoshis int64 `json:"inputSatoshis,omitempty"`
|
||||||
Outputs []txOutputs `json:"outputs"`
|
Outputs []txOutputs `json:"outputs"`
|
||||||
// OutputSatoshis uint64 `json:"outputSatoshis,omitempty"`
|
// OutputSatoshis int64 `json:"outputSatoshis,omitempty"`
|
||||||
// FeeSatoshis uint64 `json:"feeSatoshis,omitempty"`
|
// FeeSatoshis int64 `json:"feeSatoshis,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type addressHistoryItem struct {
|
type addressHistoryItem struct {
|
||||||
Addresses map[string]addressHistoryIndexes `json:"addresses"`
|
Addresses map[string]addressHistoryIndexes `json:"addresses"`
|
||||||
Satoshis uint64 `json:"satoshis"`
|
Satoshis int64 `json:"satoshis"`
|
||||||
Confirmations int `json:"confirmations"`
|
Confirmations int `json:"confirmations"`
|
||||||
Tx resTx `json:"tx"`
|
Tx resTx `json:"tx"`
|
||||||
}
|
}
|
||||||
@ -353,7 +353,7 @@ func (s *SocketIoServer) getAddressHistory(addr []string, opts *addrOpts) (res r
|
|||||||
for _, vout := range tx.Vout {
|
for _, vout := range tx.Vout {
|
||||||
aoh := vout.ScriptPubKey.Hex
|
aoh := vout.ScriptPubKey.Hex
|
||||||
ao := txOutputs{
|
ao := txOutputs{
|
||||||
Satoshis: vout.ValueSat.Uint64(),
|
Satoshis: vout.ValueSat.Int64(),
|
||||||
Script: &aoh,
|
Script: &aoh,
|
||||||
}
|
}
|
||||||
voutAddr, err := s.getAddressesFromVout(&vout)
|
voutAddr, err := s.getAddressesFromVout(&vout)
|
||||||
@ -626,12 +626,12 @@ func (s *SocketIoServer) getDetailedTransaction(txid string) (res resultGetDetai
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return res, err
|
return res, err
|
||||||
}
|
}
|
||||||
ai.Satoshis = vout.ValueSat.Uint64()
|
ai.Satoshis = vout.ValueSat.Int64()
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if len(ta.Outputs) > int(vin.Vout) {
|
if len(ta.Outputs) > int(vin.Vout) {
|
||||||
output := &ta.Outputs[vin.Vout]
|
output := &ta.Outputs[vin.Vout]
|
||||||
ai.Satoshis = output.ValueSat.Uint64()
|
ai.Satoshis = output.ValueSat.Int64()
|
||||||
voutAddr, _, err = output.Addresses(s.chainParser)
|
voutAddr, _, err = output.Addresses(s.chainParser)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return res, err
|
return res, err
|
||||||
@ -647,7 +647,7 @@ func (s *SocketIoServer) getDetailedTransaction(txid string) (res resultGetDetai
|
|||||||
for _, vout := range tx.Vout {
|
for _, vout := range tx.Vout {
|
||||||
aos := vout.ScriptPubKey.Hex
|
aos := vout.ScriptPubKey.Hex
|
||||||
ao := txOutputs{
|
ao := txOutputs{
|
||||||
Satoshis: vout.ValueSat.Uint64(),
|
Satoshis: vout.ValueSat.Int64(),
|
||||||
Script: &aos,
|
Script: &aos,
|
||||||
}
|
}
|
||||||
voutAddr, err := s.getAddressesFromVout(&vout)
|
voutAddr, err := s.getAddressesFromVout(&vout)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user