bsctypes

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: LGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BscAccount

type BscAccount struct {
	// contains filtered or unexported fields
}

BscAccount indicates the user's identity information used for interaction with BSC.

func NewBscAccountFromPrivateKey

func NewBscAccountFromPrivateKey(name, privKey string) (*BscAccount, error)

func (*BscAccount) GetAddress

func (a *BscAccount) GetAddress() *common.Address

GetAddress - Get the address of the account.

func (*BscAccount) GetKeyManager

func (a *BscAccount) GetKeyManager() KeyManager

GetKeyManager - Get the key manager of the account.

type BscKeyManager

type BscKeyManager struct {
	// contains filtered or unexported fields
}

func (*BscKeyManager) GetAddr

func (k *BscKeyManager) GetAddr() *common.Address

func (*BscKeyManager) GetPrivateKey

func (k *BscKeyManager) GetPrivateKey() *ecdsa.PrivateKey

type BucketVisibilityType

type BucketVisibilityType uint8
const (
	Unspecified BucketVisibilityType = iota
	PublicRead
	Private
	Inherit
)

type CreateBucketSynPackage

type CreateBucketSynPackage struct {
	Creator                        *common.Address      `json:"creator"`
	Name                           string               `json:"name"`
	Visibility                     BucketVisibilityType `json:"visibility"`
	PaymentAddress                 *common.Address      `json:"paymentAddress"`
	PrimarySpAddress               *common.Address      `json:"primarySpAddress"`
	PrimarySpApprovalExpiredHeight uint64               `json:"primarySpApprovalExpiredHeight"`
	GlobalVirtualGroupFamilyId     uint32               `json:"globalVirtualGroupFamilyId"`
	PrimarySpSignature             []byte               `json:"primarySpSignature"`
	ChargedReadQuota               uint64               `json:"chargedReadQuota"`
	ExtraData                      []byte               `json:"extraData"`
}

type Deployment

type Deployment struct {
	DeployCommitId           string `json:"DeployCommitId"`
	BlockNumber              int    `json:"BlockNumber"`
	EmergencyOperator        string `json:"EmergencyOperator"`
	EmergencyUpgradeOperator string `json:"EmergencyUpgradeOperator"`
	Deployer                 string `json:"Deployer"`
	ProxyAdmin               string `json:"ProxyAdmin"`
	GovHub                   string `json:"GovHub"`
	CrossChain               string `json:"CrossChain"`
	MultiMessage             string `json:"MultiMessage"`
	GreenfieldExecutor       string `json:"GreenfieldExecutor"`
	TokenHub                 string `json:"TokenHub"`
	LightClient              string `json:"LightClient"`
	RelayerHub               string `json:"RelayerHub"`
	BucketHub                string `json:"BucketHub"`
	ObjectHub                string `json:"ObjectHub"`
	GroupHub                 string `json:"GroupHub"`
	AdditionalBucketHub      string `json:"AdditionalBucketHub"`
	AdditionalObjectHub      string `json:"AdditionalObjectHub"`
	AdditionalGroupHub       string `json:"AdditionalGroupHub"`
	BucketERC721Token        string `json:"BucketERC721Token"`
	ObjectERC721Token        string `json:"ObjectERC721Token"`
	GroupERC721Token         string `json:"GroupERC721Token"`
	MemberERC1155Token       string `json:"MemberERC1155Token"`
	InitConsensusState       struct {
		ChainID              string `json:"chainID"`
		Height               int    `json:"height"`
		NextValidatorSetHash string `json:"nextValidatorSetHash"`
		Validators           []struct {
			PubKey         string `json:"pubKey"`
			VotingPower    int    `json:"votingPower"`
			RelayerAddress string `json:"relayerAddress"`
			RelayerBlsKey  string `json:"relayerBlsKey"`
		} `json:"validators"`
		ConsensusStateBytes string `json:"consensusStateBytes"`
	} `json:"initConsensusState"`
	GnfdChainId             int    `json:"gnfdChainId"`
	PermissionDeployer      string `json:"PermissionDeployer"`
	PermissionHub           string `json:"PermissionHub"`
	AdditionalPermissionHub string `json:"AdditionalPermissionHub"`
	PermissionToken         string `json:"PermissionToken"`
}

type Environment added in v1.7.1

type Environment uint8
const (
	BscDevnet Environment = iota
	BscQanet
	BscTestnet
	BscMainnet
	OpBNBDevnet
	OpBNBQanet
	OpBNBTestnet
	OpBNBMainnet
)

type ExecutorBatchedMessage

type ExecutorBatchedMessage struct {
	Message        []*ExecutorMessageUnit
	Deployment     *Deployment
	RelayFee       *big.Int
	MinAckRelayFee *big.Int
}

func NewExecutorBatchedMessage

func NewExecutorBatchedMessage(deployment *Deployment, relayFee *big.Int, minAckRelayFee *big.Int) *ExecutorBatchedMessage

func (*ExecutorBatchedMessage) Build

func (*ExecutorBatchedMessage) CancelMigrateBucket

func (*ExecutorBatchedMessage) CopyObject

func (*ExecutorBatchedMessage) CreatePaymentAccount

func (*ExecutorBatchedMessage) Deposit

func (*ExecutorBatchedMessage) DisableRefund

func (*ExecutorBatchedMessage) MigrateBucket

func (*ExecutorBatchedMessage) SetBucketFlowRateLimit

func (*ExecutorBatchedMessage) SetTag

func (*ExecutorBatchedMessage) ToggleSPAsDelegatedAgent

func (*ExecutorBatchedMessage) UpdateBucketInfo

func (*ExecutorBatchedMessage) UpdateGroupExtra

func (*ExecutorBatchedMessage) UpdateObjectInfo

func (*ExecutorBatchedMessage) Withdraw

type ExecutorMessageUnit

type ExecutorMessageUnit struct {
	MsgType  uint8
	MsgBytes []byte
}

type ExecutorMessages

type ExecutorMessages struct {
	MsgTypes []uint8
	MsgBytes [][]byte
	RelayFee *big.Int
}

ExecutorMessages * * Supported message types and its corresponding number * 1: CreatePaymentAccount * 2: Deposit * 3: DisableRefund * 4: Withdraw * 5: MigrateBucket * 6: CancelMigrateBucket * 7: UpdateBucketInfo * 8: ToggleSPAsDelegatedAgent * 9: SetBucketFlowRateLimit * 10: CopyObject * 11: UpdateObjectInfo * 12: UpdateGroupExtra * 13: SetTag

type ExtraData

type ExtraData struct {
	AppAddress            *common.Address       `json:"appAddress"`
	RefundAddress         *common.Address       `json:"refundAddress"`
	FailureHandleStrategy FailureHandleStrategy `json:"failureHandleStrategy"`
	CallbackData          []byte                `json:"callbackData"`
}

type FailureHandleStrategy

type FailureHandleStrategy uint8
const (
	BlockOnFail FailureHandleStrategy = iota
	CacheOnFail
	SkipOnFail
)

type IMessages

type IMessages interface {
	CreateBucket(sender *common.Address, synPkg *CreateBucketSynPackage) *Messages
	CreateBucketCallBack(sender *common.Address, synPkg *CreateBucketSynPackage, callbackGasLimit *big.Int, extraData *ExtraData, opt *RelayFeeOption) *Messages
	DeleteBucket(sender *common.Address, id *big.Int) *Messages
	DeleteBucketCallBack(sender *common.Address, id *big.Int, callbackGasLimit *big.Int, extraData *ExtraData, opt *RelayFeeOption) *Messages
	DeleteObject(sender *common.Address, id *big.Int) *Messages
	DeleteObjectCallBack(sender *common.Address, id *big.Int, callbackGasLimit *big.Int, extraData *ExtraData, opt *RelayFeeOption) *Messages
	CreateGroup(sender *common.Address, owner *common.Address, name string) *Messages
	CreateGroupCallBack(sender *common.Address, owner *common.Address, name string, callbackGasLimit *big.Int, extraData *ExtraData, opt *RelayFeeOption) *Messages
	DeleteGroup(sender *common.Address, id *big.Int) *Messages
	DeleteGroupCallBack(sender *common.Address, id *big.Int, callbackGasLimit *big.Int, extraData *ExtraData, opt *RelayFeeOption) *Messages
	UpdateGroup(sender *common.Address, synPkg *UpdateGroupMemberSynPackage) *Messages
	UpdateGroupCallBack(sender *common.Address, synPkg *UpdateGroupMemberSynPackage, callbackGasLimit *big.Int, extraData *ExtraData, opt *RelayFeeOption) *Messages
	CreatePolicy(sender *common.Address, policy *permissiontype.Policy) *Messages
	CreatePolicyCallBack(sender *common.Address, policy *permissiontype.Policy, extraData *ExtraData, opt *RelayFeeOption) *Messages
	DeletePolicy(sender *common.Address, id *big.Int) *Messages
	DeletePolicyCallBack(sender *common.Address, id *big.Int, extraData *ExtraData, opt *RelayFeeOption) *Messages
	TransferOut(sender *common.Address, recipient *common.Address, amount *big.Int) *Messages
}

type KeyManager

type KeyManager interface {
	GetPrivateKey() *ecdsa.PrivateKey
	GetAddr() *common.Address
}

func NewBscKeyManager

func NewBscKeyManager(privateKeyHex string) (KeyManager, error)

type Message

type Message struct {
	Target *common.Address
	Data   []byte
	Value  *big.Int
}

type Messages

type Messages struct {
	Message          []*Message
	Deployment       *Deployment
	RelayFee         *big.Int
	MinAckRelayFee   *big.Int
	CallbackGasPrice *big.Int
}

func NewMessages

func NewMessages(deployment *Deployment, relayFee *big.Int, minAckRelayFee *big.Int, callbackGasPrice *big.Int) *Messages

func (*Messages) Build

func (m *Messages) Build() *MultiMessage

func (*Messages) CreateBucket

func (m *Messages) CreateBucket(sender *common.Address, synPkg *CreateBucketSynPackage) *Messages

func (*Messages) CreateBucketCallBack

func (m *Messages) CreateBucketCallBack(sender *common.Address, synPkg *CreateBucketSynPackage, callbackGasLimit *big.Int, extraData *ExtraData, opt *RelayFeeOption) *Messages

func (*Messages) CreateGroup

func (m *Messages) CreateGroup(sender *common.Address, owner *common.Address, name string) *Messages

func (*Messages) CreateGroupCallBack

func (m *Messages) CreateGroupCallBack(sender *common.Address, owner *common.Address, name string, callbackGasLimit *big.Int, extraData *ExtraData, opt *RelayFeeOption) *Messages

func (*Messages) CreatePolicy

func (m *Messages) CreatePolicy(sender *common.Address, policy *permissiontype.Policy) *Messages

func (*Messages) CreatePolicyCallBack

func (m *Messages) CreatePolicyCallBack(sender *common.Address, policy *permissiontype.Policy, extraData *ExtraData, opt *RelayFeeOption) *Messages

func (*Messages) DeleteBucket

func (m *Messages) DeleteBucket(sender *common.Address, id *big.Int) *Messages

func (*Messages) DeleteBucketCallBack

func (m *Messages) DeleteBucketCallBack(sender *common.Address, id *big.Int, callbackGasLimit *big.Int, extraData *ExtraData, opt *RelayFeeOption) *Messages

func (*Messages) DeleteGroup

func (m *Messages) DeleteGroup(sender *common.Address, id *big.Int) *Messages

func (*Messages) DeleteGroupCallBack

func (m *Messages) DeleteGroupCallBack(sender *common.Address, id *big.Int, callbackGasLimit *big.Int, extraData *ExtraData, opt *RelayFeeOption) *Messages

func (*Messages) DeleteObject

func (m *Messages) DeleteObject(sender *common.Address, id *big.Int) *Messages

func (*Messages) DeleteObjectCallBack

func (m *Messages) DeleteObjectCallBack(sender *common.Address, id *big.Int, callbackGasLimit *big.Int, extraData *ExtraData, opt *RelayFeeOption) *Messages

func (*Messages) DeletePolicy

func (m *Messages) DeletePolicy(sender *common.Address, id *big.Int) *Messages

func (*Messages) DeletePolicyCallBack

func (m *Messages) DeletePolicyCallBack(sender *common.Address, id *big.Int, extraData *ExtraData, opt *RelayFeeOption) *Messages

func (*Messages) TransferOut

func (m *Messages) TransferOut(sender *common.Address, recipient *common.Address, amount *big.Int) *Messages

func (*Messages) UpdateGroup

func (m *Messages) UpdateGroup(sender *common.Address, synPkg *UpdateGroupMemberSynPackage) *Messages

func (*Messages) UpdateGroupCallBack

func (m *Messages) UpdateGroupCallBack(sender *common.Address, synPkg *UpdateGroupMemberSynPackage, callbackGasLimit *big.Int, extraData *ExtraData, opt *RelayFeeOption) *Messages

type MultiMessage

type MultiMessage struct {
	Targets []common.Address
	Data    [][]byte
	Values  []*big.Int
}

type RelayFeeOption

type RelayFeeOption struct {
	AckRelayFee *big.Int
}

type UpdateGroupMemberSynPackage

type UpdateGroupMemberSynPackage struct {
	Operator         *common.Address   `json:"operator"`
	Id               *big.Int          `json:"Id"`
	OpType           UpdateGroupOpType `json:"opType"`
	Members          []common.Address  `json:"members"`
	ExtraData        []byte            `json:"extraData"`
	MemberExpiration []uint64          `json:"memberExpiration"`
}

type UpdateGroupOpType

type UpdateGroupOpType uint8
const (
	AddMembers UpdateGroupOpType = iota
	RemoveMembers
	RenewMembers
)

Jump to

Keyboard shortcuts

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