plutus

package
v1.1.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 18, 2022 License: MIT Imports: 8 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HTTPClient = http.Client{
	Timeout: time.Second * 15,
}

HTTPClient a usable client with hardcoded timeout

View Source
var ProductionURL = "https://plutus.polispay.com"

ProductionURL is the current plutus production url

Functions

func GetWalletAddress

func GetWalletAddress(productionURL string, coin string, signature string, service string, username string, password string, plutusKey string, masterPass string) (address string, err error)

GetWalletAddress gets an address from a given coin

Types

type Address

type Address struct {
	Valid bool `json:"valid"`
}

Address is the model for the GET plutus address validation method

type Balance

type Balance struct {
	Confirmed   float64 `json:"confirmed"`
	Unconfirmed float64 `json:"unconfirmed"`
}

Balance is the model for the GET plutus balance method

func GetWalletBalance

func GetWalletBalance(productionURL string, coin string, signature string, service string, username string, password string, plutusKey string, masterPass string) (balance Balance, err error)

GetWalletBalance gets an address from a given coin

type DecodedRawTX

type DecodedRawTX struct {
	Locktime int    `json:"locktime"`
	Size     int    `json:"size"`
	Txid     string `json:"txid"`
	Version  int    `json:"version"`
	Vin      []struct {
		ScriptSig struct {
			Asm string `json:"asm"`
			Hex string `json:"hex"`
		} `json:"scriptSig"`
		Sequence int64  `json:"sequence"`
		Txid     string `json:"txid"`
		Vout     int    `json:"vout"`
	} `json:"vin"`
	Vout []struct {
		N            int `json:"n"`
		ScriptPubKey struct {
			Addresses []string `json:"addresses"`
			Asm       string   `json:"asm"`
			Hex       string   `json:"hex"`
			ReqSigs   int      `json:"reqSigs"`
			Type      string   `json:"type"`
		} `json:"scriptPubKey"`
		Value    float64 `json:"value"`
		ValueSat int     `json:"valueSat"`
	} `json:"vout"`
}

DecodedRawTX is the model for the verify RAW transaction

func DecodeRawTX

func DecodeRawTX(productionURL string, payload []byte, coin string, signature string, service string, username string, password string, plutusKey string, masterPass string) (rawTX DecodedRawTX, err error)

DecodeRawTX gets all the information from a given coin

type Info

type Info struct {
	Blocks      int    `json:"blocks"`
	Headers     int    `json:"headers"`
	Chain       string `json:"chain"`
	Protocol    int    `json:"protocol"`
	Version     int    `json:"version"`
	SubVersion  string `json:"subversion"`
	Connections int    `json:"connections"`
}

Info is the model for the GET plutus info method

func GetWalletInfo

func GetWalletInfo(productionURL string, coin string, signature string, service string, username string, password string, plutusKey string, masterPass string) (info Info, err error)

GetWalletInfo gets an address from a given coin

type SendAddressBodyReq

type SendAddressBodyReq struct {
	Address string  `json:"address"`
	Coin    string  `json:"coin"`
	Amount  float64 `json:"amount"`
}

type SendAddressInternalBodyReq

type SendAddressInternalBodyReq struct {
	Coin   string  `json:"coin"`
	Amount float64 `json:"amount"`
}

type Status

type Status struct {
	Blocks          int  `json:"node_blocks"`
	Headers         int  `json:"node_headers"`
	ExternalBlocks  int  `json:"external_blocks"`
	ExternalHeaders int  `json:"external_headers"`
	SyncStatus      bool `json:"synced"`
}

Status is the model for the GET plutus status method

func GetWalletStatus

func GetWalletStatus(productionURL string, coin string, signature string, service string, username string, password string, plutusKey string, masterPass string) (status Status, err error)

GetWalletStatus gets all the information from a given coin

type Transaction

type Transaction struct {
	Blockhash     string `json:"blockhash"`
	Blocktime     int    `json:"blocktime"`
	Confirmations int    `json:"confirmations"`
	Height        int    `json:"height"`
	Hex           string `json:"hex"`
	Locktime      int    `json:"locktime"`
	Size          int    `json:"size"`
	Time          int    `json:"time"`
	Txid          string `json:"txid"`
	Version       int    `json:"version"`
	Vin           []struct {
		ScriptSig struct {
			Asm string `json:"asm"`
			Hex string `json:"hex"`
		} `json:"scriptSig"`
		Sequence int64  `json:"sequence"`
		Txid     string `json:"txid"`
		Vout     int    `json:"vout"`
	} `json:"vin"`
	Vout []struct {
		N            int `json:"n"`
		ScriptPubKey struct {
			Addresses []string `json:"addresses"`
			Asm       string   `json:"asm"`
			Hex       string   `json:"hex"`
			ReqSigs   int      `json:"reqSigs"`
			Type      string   `json:"type"`
		} `json:"scriptPubKey"`
		Value    float64 `json:"value"`
		ValueSat int64   `json:"valueSat"`
	} `json:"vout"`
}

Transaction is the model for the GET plutus transaction method

func GetWalletTX

func GetWalletTX(productionURL string, coin string, tx string, signature string, service string, username string, password string, plutusKey string, masterPass string) (transaction Transaction, err error)

GetWalletTX gets a transaction info from the wallets

type ValidateRawTxReq

type ValidateRawTxReq struct {
	Coin    string `json:"coin"`
	RawTx   string `json:"raw_tx"`
	Amount  int64  `json:"amount"`
	Address string `json:"address"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL