utils

package
v0.0.0-...-f2ff57a Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const CALL_CONTRACT = "Circular_CallContract_"
View Source
const CHECK_WALLET = "Circular_CheckWallet_"
View Source
const GET_ANALYTICS = "Circular_GetAnalytics_"
View Source
const GET_ASSET = "Circular_GetAsset_"
View Source
const GET_ASSET_LIST = "Circular_GetAssetList_"
View Source
const GET_ASSET_SUPPLY = "Circular_GetAssetSupply_"
View Source
const GET_BLOCK = "Circular_GetBlock_"
View Source
const GET_BLOCKCHAINS = "Circular_GetBlockchains_"
View Source
const GET_BLOCK_COUNT = "Circular_GetBlockCount_"
View Source
const GET_BLOCK_RANGE = "Circular_GetBlockRange_"
View Source
const GET_DOMAIN = "Circular_GetDomain_"
View Source
const GET_LATEST_TRANSACTIONS = "Circular_GetLatestTransactions_"
View Source
const GET_PENDING_TRANSACTION = "Circular_GetPendingTransaction_"
View Source
const GET_TRANSACTIONS_BY_ADDRESS = "Circular_GetTransactionbyAddress_"
View Source
const GET_TRANSACTION_BY_DATE = "Circular_GetTransactionbyDate_"
View Source
const GET_TRANSACTION_BY_ID = "Circular_GetTransactionbyID_"
View Source
const GET_TRANSACTION_BY_NODE = "Circular_GetTransactionbyNode_"
View Source
const GET_VOUCHER = "Circular_GetVoucher_"
View Source
const GET_WALLET = "Circular_GetWallet_"
View Source
const GET_WALLET_BALANCE = "Circular_GetWalletBalance_"
View Source
const GET_WALLET_NONCE = "Circular_GetWalletNonce_"
View Source
const REGISTER_WALLET = "Circular_RegisterWallet_"
View Source
const SEND_TRANSACTION = "Circular_AddTransaction_"
View Source
const TEST_CONTRACT = "Circular_TestContract_"

Variables

This section is empty.

Functions

func GetFormattedTimestamp

func GetFormattedTimestamp() string

Generate formatted timestamp in the format YYYY-MM-DD-HH:MM:SS

func GetKeysFromString

func GetKeysFromString(seedPhrase string) (map[string]string, error)

func GetPublicKey

func GetPublicKey(privateKey string) string

func HexFix

func HexFix(word interface{}) string

HexFix removes the prefix "0x"

func HexToString

func HexToString(hexStr string) (string, error)

HexToString coneverts a hexadecimal string to a string

func PadNumber

func PadNumber(number int) string

PadNumber pads a number with leading zeros to number less than 10

func SendRequest

func SendRequest(data interface{}, nagFunction string, nagURL string) map[string]interface{}
SendRequest sends an HTTP POST request with JSON data

* @param data interface{} - data to send * @param nagFunction string - function to call * @param nagURL string - URL to call * @return map[string]interface{} - response * @return error - error

SendRequest esegue una richiesta HTTP POST e gestisce la risposta JSON

func Sha256

func Sha256(data string) string

Sha256 calculates the SHA-256 hash of a string

func SignMessage

func SignMessage(message string, privateKey string) map[string]interface{}

func StringToHex

func StringToHex(str string) string

StringToHex converts a string to a hexadecimal string

func VerifySignature

func VerifySignature(publicKey string, message string, signature string) bool

Types

type ECDSASignature

type ECDSASignature struct {
	R, S *big.Int
}

type ECSignature

type ECSignature struct {
	R, S *big.Int
}

ECSignature defines the structure for DER encoded signature

Jump to

Keyboard shortcuts

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