gmar

package
v0.100.18 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ManifestFile        = "manifest.w3tools"
	ManifestContentType = "application/x.arweave-manifest+json"
	IndexFile           = "index.html"
)

Variables

This section is empty.

Functions

func WriteManifest

func WriteManifest(name string, data []byte) error

Types

type ArweaveClient

type ArweaveClient struct {
	Node   string
	Wallet *goar.Wallet
	Client *goar.Client
}

func InitArweaveClient

func InitArweaveClient(keyFile, node string) (*ArweaveClient, error)

func (*ArweaveClient) GetBalance

func (a *ArweaveClient) GetBalance() (arAmount *big.Float, err error)

func (*ArweaveClient) GetTransaction

func (a *ArweaveClient) GetTransaction(data []byte, manifest bool) (*types.Transaction, error)

func (*ArweaveClient) GetTxPrice

func (a *ArweaveClient) GetTxPrice(data []byte) (int64, error)

func (*ArweaveClient) NewManifest

func (a *ArweaveClient) NewManifest(path string) (*ArweaveManifest, error)

func (*ArweaveClient) UploadTo

func (a *ArweaveClient) UploadTo(data []byte, manifest bool) (*types.Transaction, error)

func (*ArweaveClient) UploadToTxHash

func (a *ArweaveClient) UploadToTxHash(data []byte, manifest bool) (string, error)

func (*ArweaveClient) UploadToUrl

func (a *ArweaveClient) UploadToUrl(data []byte, manifest bool) (string, error)

type ArweaveManifest

type ArweaveManifest struct {
	Manifest string                         `json:"manifest"`
	Version  string                         `json:"version"`
	Index    ArweaveManifestIndex           `json:"index"`
	Paths    map[string]ArweaveManifestPath `json:"paths"`
}

func NewManifest

func NewManifest() *ArweaveManifest

type ArweaveManifestIndex

type ArweaveManifestIndex struct {
	Path string `json:"path"`
}

type ArweaveManifestPath

type ArweaveManifestPath struct {
	ID string `json:"id"`
}

Jump to

Keyboard shortcuts

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