cmd

package
v2.5.5 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2026 License: Apache-2.0 Imports: 62 Imported by: 0

Documentation

Overview

Copyright © 2023 Glif LTD

Copyright © 2023 NAME HERE <EMAIL ADDRESS>

Copyright © 2023 NAME HERE <EMAIL ADDRESS>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright © 2023 Glif LTD

Index

Constants

View Source
const (
	MAINNET_GLIF_LTD_DELEGATEE = "0xfF0000000000000000000000000000000035909b"
	TESTNET_GLIF_LTD_DELEGATEE = "0xFf000000000000000000000000000000000254d7"
)
View Source
const (
	VOTE_QUESTION_LANGUAGE                = "You are about to claim your airdrop, we have a few extra questions for you. What language would you like to continue in?"
	VOTE_OPTION_LANGUAGE_ENGLISH language = "English"
	VOTE_OPTION_LANGUAGE_CHINESE language = "中文"
)

question 1

View Source
const (
	VOTE_QUESTION_DELEGATEE               = "The GLF Token has governance capabilities. Who do you want to delegate your vote to?"
	VOTE_QUESTION_DELEGATEE_CHINESE       = "GLF 代币具有治理功能。你想将你的投票委托给谁?"
	VOTE_OPTION_DELEGATEE_GLIF_LTD        = "Glif Ltd. - the development company"
	VOTE_OPTION_DELEGATEE_MYSELF          = "Myself - I will vote on proposals"
	VOTE_OPTION_DELEGATEE_SOMEONE_ELSE    = "Someone else - I know their address"
	VOTE_OPTION_DELEGATEE_GLIF_LTD_CH     = "Glif Ltd. - 开发公司"
	VOTE_OPTION_DELEGATEE_MYSELF_CH       = "我自己 - 我将参与提案投票"
	VOTE_OPTION_DELEGATEE_SOMEONE_ELSE_CH = "其他人 - 我知道他们的地址"
)

question 2

View Source
const (
	VOTE_QUESTION_DELEGATEE_ADDRESS         = "Please enter the address of the person you want to delegate your vote to:"
	VOTE_QUESTION_DELEGATEE_ADDRESS_CHINESE = "请输入你想委托投票的人的地址:"
)

question 2.5

View Source
const (
	VOTE_QUESTION_ROADMAP         = "" /* 486-byte string literal not displayed */
	VOTE_QUESTION_ROADMAP_CHINESE = "" /* 448-byte string literal not displayed */
	VOTE_OPTION_ROADMAP_CONT_EN   = "Finish"
	VOTE_OPTION_ROADMAP_CONT_CH   = "完成"
)
View Source
const (
	VOTE_QUESTION_ACCEPT_TERMS         = "By claiming your airdrop, you are agreeing to the terms and conditions at https://glif.io/terms. Do you accept?"
	VOTE_QUESTION_ACCEPT_TERMS_CHINESE = "通过领取空投,你同意 https://glif.io/terms 的条款和条件。你接受吗?"
	VOTE_OPTION_ACCEPT_TERMS_YES       = "Yes"
	VOTE_OPTION_ACCEPT_TERMS_YES_CH    = "是"
	VOTE_OPTION_ACCEPT_TERMS_NO        = "No"
	VOTE_OPTION_ACCEPT_TERMS_NO_CH     = "否"
)

question 3

Variables

View Source
var CommitHash, GoPoolsHash = func() (string, string) {
	var ch string
	if info, ok := debug.ReadBuildInfo(); ok {
		for _, setting := range info.Settings {
			if setting.Key == "vcs.revision" {
				ch = setting.Value
			}
		}

		for _, dep := range info.Deps {
			if dep.Path == "github.com/glifio/go-pools" {
				return ch, dep.Version
			}
		}
	}
	return "", ""
}()
View Source
var ExitCode int
View Source
var PoolsSDK types.PoolsSDK

Functions

func AddressOrAccountNameToEVM

func AddressOrAccountNameToEVM(ctx context.Context, addr string) (common.Address, error)

func AddressOrAccountNameToNative

func AddressOrAccountNameToNative(ctx context.Context, addr string) (address.Address, error)

func AddressesToStrings

func AddressesToStrings(addrs []address.Address) []string

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func Exit

func Exit(code int)

func GetFilecoinPriceUSD added in v2.4.2

func GetFilecoinPriceUSD() (float64, error)

Function to fetch the current USD price of Filecoin

func ToMinerID

func ToMinerID(ctx context.Context, addr string) (address.Address, error)

Types

type CoinGeckoResponse added in v2.4.2

type CoinGeckoResponse struct {
	Filecoin struct {
		USD float64 `json:"usd"`
	} `json:"filecoin"`
}

CoinGecko API response structure

type GitHubRelease

type GitHubRelease struct {
	TagName    string `json:"tag_name"`
	PreRelease bool   `json:"prerelease"`
	Draft      bool   `json:"draft"`
}

GitHubRelease represents the structure of the release object from GitHub's API

type GitHubTag

type GitHubTag struct {
	Object struct {
		SHA string `json:"sha"`
	} `json:"object"`
}

GitHubTag represents the structure of the tag object, which includes the commit hash

type MockFullNodeAPI

type MockFullNodeAPI struct {
	api.FullNode
}

func (*MockFullNodeAPI) StateGetActor

func (m *MockFullNodeAPI) StateGetActor(ctx context.Context, actor address.Address, tsk types.TipSetKey) (*types.Actor, error)

func (*MockFullNodeAPI) StateLookupID

func (m *MockFullNodeAPI) StateLookupID(ctx context.Context, addr address.Address, tsk types.TipSetKey) (address.Address, error)

type PaymentType

type PaymentType int
const (
	Principal PaymentType = iota
	ToCurrent
	Custom
)

func ParsePaymentType

func ParsePaymentType(s string) (PaymentType, error)

func (PaymentType) String

func (p PaymentType) String() string

type PoolType

type PoolType uint64
const (
	InfinityPool PoolType = iota
)

type QuotePath added in v2.4.0

type QuotePath string
const (
	QuotePathFILGLF QuotePath = "fil:glf"
	QuotePathGLFFIL QuotePath = "glf:fil"
)

Source Files

Jump to

Keyboard shortcuts

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