types

package
v0.0.0-...-28a2c90 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2025 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

View Source
const (
	NotaryModeIntBasic tktypes.HexUint64 = 0x0000
	NotaryModeIntHooks tktypes.HexUint64 = 0x0001
)

Variables

View Source
var NotoABI = solutils.MustParseBuildABI(notoPrivateJSON)
View Source
var NotoCoinABI = &abi.Parameter{
	Name:         "NotoCoin",
	Type:         "tuple",
	InternalType: "struct NotoCoin",
	Components: abi.ParameterArray{
		{Name: "salt", Type: "bytes32"},
		{Name: "owner", Type: "string", Indexed: true},
		{Name: "amount", Type: "uint256", Indexed: true},
	},
}
View Source
var NotoConfigABI_V0 = &abi.ParameterArray{
	{Name: "notaryAddress", Type: "address"},
	{Name: "variant", Type: "bytes32"},
	{Name: "data", Type: "bytes"},
}
View Source
var NotoConfigID_V0 = tktypes.MustParseHexBytes("0x00010000")
View Source
var NotoLockInfoABI = &abi.Parameter{
	Name:         "NotoLockInfo",
	Type:         "tuple",
	InternalType: "struct NotoLockInfo",
	Components: abi.ParameterArray{
		{Name: "salt", Type: "bytes32"},
		{Name: "lockId", Type: "bytes32"},
		{Name: "owner", Type: "address"},
		{Name: "delegate", Type: "address"},
	},
}
View Source
var NotoLockedCoinABI = &abi.Parameter{
	Name:         "NotoLockedCoin",
	Type:         "tuple",
	InternalType: "struct NotoLockedCoin",
	Components: abi.ParameterArray{
		{Name: "salt", Type: "bytes32"},
		{Name: "lockId", Type: "bytes32", Indexed: true},
		{Name: "owner", Type: "string", Indexed: true},
		{Name: "amount", Type: "uint256"},
	},
}
View Source
var NotoTransactionDataABI_V0 = &abi.ParameterArray{
	{Name: "transactionId", Type: "bytes32"},
	{Name: "infoStates", Type: "bytes32[]"},
}
View Source
var NotoTransactionDataID_V0 = tktypes.MustParseHexBytes("0x00010000")
View Source
var NotoVariantDefault tktypes.HexUint64 = 0x0000
View Source
var TransactionDataABI = &abi.Parameter{
	Name:         "TransactionData",
	Type:         "tuple",
	InternalType: "struct TransactionData",
	Components: abi.ParameterArray{
		{Name: "salt", Type: "bytes32"},
		{Name: "data", Type: "bytes"},
	},
}

Functions

This section is empty.

Types

type ApproveExtraParams

type ApproveExtraParams struct {
	Data tktypes.HexBytes `json:"data"`
}

type ApproveParams

type ApproveParams struct {
	Inputs   []*pldapi.StateEncoded `json:"inputs"`
	Outputs  []*pldapi.StateEncoded `json:"outputs"`
	Data     tktypes.HexBytes       `json:"data"`
	Delegate *tktypes.EthAddress    `json:"delegate"`
}

type BurnParams

type BurnParams struct {
	Amount *tktypes.HexUint256 `json:"amount"`
	Data   tktypes.HexBytes    `json:"data"`
}

type ConstructorParams

type ConstructorParams struct {
	Notary         string      `json:"notary"`                   // Lookup string for the notary identity
	NotaryMode     NotaryMode  `json:"notaryMode"`               // Notary mode (basic or hooks)
	Implementation string      `json:"implementation,omitempty"` // Use a specific implementation of Noto that was registered to the factory (blank to use default)
	Options        NotoOptions `json:"options"`                  // Configure options for the chosen notary mode
}

type DelegateLockParams

type DelegateLockParams struct {
	LockID   tktypes.Bytes32     `json:"lockId"`
	Delegate *tktypes.EthAddress `json:"delegate"`
	Data     tktypes.HexBytes    `json:"data"`
}

type DomainConfig

type DomainConfig struct {
	FactoryAddress string `json:"factoryAddress"`
}

type LockParams

type LockParams struct {
	Amount *tktypes.HexUint256 `json:"amount"`
	Data   tktypes.HexBytes    `json:"data"`
}

type MintParams

type MintParams struct {
	To     string              `json:"to"`
	Amount *tktypes.HexUint256 `json:"amount"`
	Data   tktypes.HexBytes    `json:"data"`
}

type NotaryMode

type NotaryMode string
const (
	NotaryModeBasic NotaryMode = "basic"
	NotaryModeHooks NotaryMode = "hooks"
)

func (NotaryMode) Enum

func (tt NotaryMode) Enum() tktypes.Enum[NotaryMode]

func (NotaryMode) Options

func (tt NotaryMode) Options() []string

type NotoBasicOptions

type NotoBasicOptions struct {
	RestrictMint   *bool `json:"restrictMint"`   // Only allow notary to mint (default: true)
	AllowBurn      *bool `json:"allowBurn"`      // Allow token holders to burn their tokens (default: true)
	AllowLock      *bool `json:"allowLock"`      // Allow token holders to lock their tokens (default: true)
	RestrictUnlock *bool `json:"restrictUnlock"` // Only allow lock creator to unlock tokens (default: true)
}

type NotoCoin

type NotoCoin struct {
	Salt   tktypes.Bytes32     `json:"salt"`
	Owner  *tktypes.EthAddress `json:"owner"`
	Amount *tktypes.HexUint256 `json:"amount"`
}

type NotoCoinState

type NotoCoinState struct {
	ID              tktypes.Bytes32    `json:"id"`
	Created         tktypes.Timestamp  `json:"created"`
	ContractAddress tktypes.EthAddress `json:"contractAddress"`
	Data            NotoCoin           `json:"data"`
}

type NotoConfigData_V0

type NotoConfigData_V0 struct {
	NotaryLookup   string              `json:"notaryLookup"`
	NotaryMode     tktypes.HexUint64   `json:"notaryMode"`
	PrivateAddress *tktypes.EthAddress `json:"privateAddress"`
	PrivateGroup   *PentePrivateGroup  `json:"privateGroup"`
	RestrictMint   bool                `json:"restrictMint"`
	AllowBurn      bool                `json:"allowBurn"`
	AllowLock      bool                `json:"allowLock"`
	RestrictUnlock bool                `json:"restrictUnlock"`
}

This is the structure we expect to unpack from the config data

type NotoConfig_V0

type NotoConfig_V0 struct {
	NotaryAddress tktypes.EthAddress `json:"notaryAddress"`
	Variant       tktypes.HexUint64  `json:"variant"`
	Data          tktypes.HexBytes   `json:"data"`
}

This is the config we expect to receive from the contract registration event

type NotoDomainReceipt

type NotoDomainReceipt struct {
	States    ReceiptStates      `json:"states"`
	Transfers []*ReceiptTransfer `json:"transfers,omitempty"`
	LockInfo  *ReceiptLockInfo   `json:"lockInfo,omitempty"`
	Data      tktypes.HexBytes   `json:"data,omitempty"`
}

type NotoHooksOptions

type NotoHooksOptions struct {
	PublicAddress     *tktypes.EthAddress `json:"publicAddress"`               // Public address of the Pente privacy group
	PrivateGroup      *PentePrivateGroup  `json:"privateGroup,omitempty"`      // Details on the Pente privacy group
	PrivateAddress    *tktypes.EthAddress `json:"privateAddress,omitempty"`    // Private address of the hook contract deployed within the privacy group
	DevUsePublicHooks bool                `json:"devUsePublicHooks,omitempty"` // Use a public hooks contract - insecure, for dev purposes only! (privateGroup/privateAddress are ignored)
}

type NotoLockInfo

type NotoLockInfo struct {
	Salt     tktypes.Bytes32     `json:"salt"`
	LockID   tktypes.Bytes32     `json:"lockId"`
	Owner    *tktypes.EthAddress `json:"owner"`
	Delegate *tktypes.EthAddress `json:"delegate"`
}

type NotoLockedCoin

type NotoLockedCoin struct {
	Salt   tktypes.Bytes32     `json:"salt"`
	LockID tktypes.Bytes32     `json:"lockId"`
	Owner  *tktypes.EthAddress `json:"owner"`
	Amount *tktypes.HexUint256 `json:"amount"`
}

type NotoLockedCoinState

type NotoLockedCoinState struct {
	ID              tktypes.Bytes32    `json:"id"`
	Created         tktypes.Timestamp  `json:"created"`
	ContractAddress tktypes.EthAddress `json:"contractAddress"`
	Data            NotoLockedCoin     `json:"data"`
}

type NotoOptions

type NotoOptions struct {
	Basic *NotoBasicOptions `json:"basic,omitempty"`
	Hooks *NotoHooksOptions `json:"hooks,omitempty"`
}

type NotoParsedConfig

type NotoParsedConfig struct {
	NotaryLookup string                   `json:"notaryLookup"`
	NotaryMode   tktypes.Enum[NotaryMode] `json:"notaryMode"`
	Variant      tktypes.HexUint64        `json:"variant"`
	IsNotary     bool                     `json:"isNotary"`
	Options      NotoOptions              `json:"options"`
}

This is the structure we parse the config into in InitConfig and gets passed back to us on every call

type NotoPublicTransaction

type NotoPublicTransaction struct {
	FunctionABI *abi.Entry       `json:"functionABI"`
	ParamsJSON  tktypes.RawJSON  `json:"paramsJSON"`
	EncodedCall tktypes.HexBytes `json:"encodedCall"`
}

type NotoTransactionData_V0

type NotoTransactionData_V0 struct {
	TransactionID tktypes.Bytes32   `json:"transactionId"`
	InfoStates    []tktypes.Bytes32 `json:"infoStates"`
}

type NotoTransferMetadata

type NotoTransferMetadata struct {
	ApprovalParams       ApproveExtraParams    `json:"approvalParams"`       // Partial set of params that can be passed to the "approveTransfer" method to approve another party to perform this transfer
	TransferWithApproval NotoPublicTransaction `json:"transferWithApproval"` // The public transaction that would need to be submitted by an approved party to perform this transfer
}

type PentePrivateGroup

type PentePrivateGroup struct {
	Salt    tktypes.Bytes32 `json:"salt"`
	Members []string        `json:"members"`
}

type ReceiptLockInfo

type ReceiptLockInfo struct {
	LockID   tktypes.Bytes32     `json:"lockId"`
	Delegate *tktypes.EthAddress `json:"delegate,omitempty"` // only set for delegateLock
	Unlock   tktypes.HexBytes    `json:"unlock,omitempty"`   // only set for prepareUnlock
}

type ReceiptState

type ReceiptState struct {
	ID   tktypes.HexBytes `json:"id"`
	Data tktypes.RawJSON  `json:"data"`
}

type ReceiptStates

type ReceiptStates struct {
	Inputs                []*ReceiptState `json:"inputs,omitempty"`
	LockedInputs          []*ReceiptState `json:"lockedInputs,omitempty"`
	Outputs               []*ReceiptState `json:"outputs,omitempty"`
	LockedOutputs         []*ReceiptState `json:"lockedOutputs,omitempty"`
	ReadInputs            []*ReceiptState `json:"readInputs,omitempty"`
	ReadLockedInputs      []*ReceiptState `json:"readLockedInputs,omitempty"`
	PreparedOutputs       []*ReceiptState `json:"preparedOutputs,omitempty"`
	PreparedLockedOutputs []*ReceiptState `json:"preparedLockedOutputs,omitempty"`
}

type ReceiptTransfer

type ReceiptTransfer struct {
	From   *tktypes.EthAddress `json:"from,omitempty"`
	To     *tktypes.EthAddress `json:"to,omitempty"`
	Amount *tktypes.HexUint256 `json:"amount"`
}

type TransactionData

type TransactionData struct {
	Salt string           `json:"salt"`
	Data tktypes.HexBytes `json:"data"`
}

type TransferParams

type TransferParams struct {
	To     string              `json:"to"`
	Amount *tktypes.HexUint256 `json:"amount"`
	Data   tktypes.HexBytes    `json:"data"`
}

type UnlockParams

type UnlockParams struct {
	LockID     tktypes.Bytes32    `json:"lockId"`
	From       string             `json:"from"`
	Recipients []*UnlockRecipient `json:"recipients"`
	Data       tktypes.HexBytes   `json:"data"`
}

type UnlockRecipient

type UnlockRecipient struct {
	To     string              `json:"to"`
	Amount *tktypes.HexUint256 `json:"amount"`
}

Jump to

Keyboard shortcuts

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