iscmagic

package
v0.4.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2022 License: Apache-2.0, BSD-2-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AddressPrefix = []byte{0x10, 0x74}
	Address       = packMagicAddress(addressKindISCMagic, nil)
)
View Source
var (
	//go:embed ISCSandbox.abi
	SandboxABI string

	//go:embed ISCUtil.abi
	UtilABI string

	//go:embed ISCAccounts.abi
	AccountsABI string

	//go:embed ISCPrivileged.abi
	PrivilegedABI string
)
View Source
var (
	//go:embed ERC20BaseTokens.abi
	ERC20BaseTokensABI string

	ERC20BaseTokensRuntimeBytecode = common.FromHex(strings.TrimSpace(erc20BaseRuntimeBytecodeHex))

	ERC20BaseTokensAddress = packMagicAddress(addressKindERC20BaseTokens, nil)
)
View Source
var (
	//go:embed ERC20NativeTokens.abi
	ERC20NativeTokensABI string

	ERC20NativeTokensRuntimeBytecode = common.FromHex(strings.TrimSpace(erc20NativeTokensRuntimeBytecodeHex))
)
View Source
var (
	//go:embed ERC721NFTs.abi
	ERC721NFTsABI string

	ERC721NFTsRuntimeBytecode = common.FromHex(strings.TrimSpace(erc721NFTsBytecodeHex))

	ERC721NFTsAddress = packMagicAddress(addressKindERC721NFTs, nil)
)

Functions

func ERC20NativeTokensAddress added in v1.0.3

func ERC20NativeTokensAddress(foundrySN uint32) common.Address

func ERC20NativeTokensFoundrySN added in v1.0.3

func ERC20NativeTokensFoundrySN(addr common.Address) (uint32, error)

Types

type ISCAgentID

type ISCAgentID struct {
	Data []byte
}

ISCAgentID matches the struct definition in ISCTypes.sol

func WrapISCAgentID

func WrapISCAgentID(a isc.AgentID) ISCAgentID

func (ISCAgentID) MustUnwrap

func (a ISCAgentID) MustUnwrap() isc.AgentID

func (ISCAgentID) Unwrap

func (a ISCAgentID) Unwrap() (isc.AgentID, error)

type ISCAllowance

type ISCAllowance struct {
	BaseTokens uint64
	Tokens     []NativeToken
	Nfts       []NFTID
}

ISCAllowance matches the struct definition in ISCTypes.sol

func WrapISCAllowance

func WrapISCAllowance(a *isc.Allowance) ISCAllowance

func (ISCAllowance) Unwrap

func (a ISCAllowance) Unwrap() *isc.Allowance

type ISCChainID

type ISCChainID [isc.ChainIDLength]byte

ISCChainID matches the type definition in ISCTypes.sol

func WrapISCChainID

func WrapISCChainID(c isc.ChainID) (ret ISCChainID)

func (ISCChainID) MustUnwrap

func (c ISCChainID) MustUnwrap() isc.ChainID

func (ISCChainID) Unwrap

func (c ISCChainID) Unwrap() (isc.ChainID, error)

type ISCDict

type ISCDict struct {
	Items []ISCDictItem
}

ISCDict matches the struct definition in ISCTypes.sol

func WrapISCDict

func WrapISCDict(d dict.Dict) ISCDict

func (ISCDict) Unwrap

func (d ISCDict) Unwrap() dict.Dict

type ISCDictItem

type ISCDictItem struct {
	Key   []byte
	Value []byte
}

ISCDictItem matches the struct definition in ISCTypes.sol

type ISCExpiration

type ISCExpiration struct {
	Time          int64
	ReturnAddress L1Address
}

func WrapISCExpiration

func WrapISCExpiration(data *isc.Expiration) ISCExpiration

func (*ISCExpiration) Unwrap

func (i *ISCExpiration) Unwrap() *isc.Expiration

type ISCFungibleTokens

type ISCFungibleTokens struct {
	BaseTokens uint64
	Tokens     []NativeToken
}

func WrapISCFungibleTokens

func WrapISCFungibleTokens(fungibleTokens isc.FungibleTokens) ISCFungibleTokens

func (ISCFungibleTokens) Unwrap

func (t ISCFungibleTokens) Unwrap() *isc.FungibleTokens

type ISCNFT

type ISCNFT struct {
	ID       NFTID
	Issuer   L1Address
	Metadata []byte
	Owner    ISCAgentID
}

ISCNFT matches the struct definition in ISCTypes.sol

func WrapISCNFT

func WrapISCNFT(n *isc.NFT) ISCNFT

func (ISCNFT) MustUnwrap

func (n ISCNFT) MustUnwrap() *isc.NFT

func (ISCNFT) Unwrap

func (n ISCNFT) Unwrap() (*isc.NFT, error)

type ISCRequestID added in v1.0.3

type ISCRequestID struct {
	Data []byte
}

ISCRequestID matches the struct definition in ISCTypes.sol

func WrapISCRequestID added in v1.0.3

func WrapISCRequestID(rid isc.RequestID) ISCRequestID

func (ISCRequestID) MustUnwrap added in v1.0.3

func (rid ISCRequestID) MustUnwrap() isc.RequestID

func (ISCRequestID) Unwrap added in v1.0.3

func (rid ISCRequestID) Unwrap() (isc.RequestID, error)

type ISCSendMetadata

type ISCSendMetadata struct {
	TargetContract uint32
	Entrypoint     uint32
	Params         ISCDict
	Allowance      ISCAllowance
	GasBudget      uint64
}

func WrapISCSendMetadata

func WrapISCSendMetadata(metadata isc.SendMetadata) ISCSendMetadata

func (ISCSendMetadata) Unwrap

func (i ISCSendMetadata) Unwrap() *isc.SendMetadata

type ISCSendOptions

type ISCSendOptions struct {
	Timelock   int64
	Expiration ISCExpiration
}

func WrapISCSendOptions

func WrapISCSendOptions(options isc.SendOptions) ISCSendOptions

func (*ISCSendOptions) Unwrap

func (i *ISCSendOptions) Unwrap() isc.SendOptions

type ISCTokenProperties added in v0.3.4

type ISCTokenProperties struct {
	Name         string
	TickerSymbol string
	Decimals     uint8
	TotalSupply  *big.Int
}

type L1Address

type L1Address struct {
	Data []byte
}

L1Address matches the struct definition in ISCTypes.sol

func WrapL1Address

func WrapL1Address(a iotago.Address) L1Address

func (L1Address) MustUnwrap

func (a L1Address) MustUnwrap() iotago.Address

func (L1Address) Unwrap

func (a L1Address) Unwrap() (iotago.Address, error)

type NFTID

type NFTID [iotago.NFTIDLength]byte

NFTID matches the type definition in ISCTypes.sol

func WrapNFTID

func WrapNFTID(c iotago.NFTID) (ret NFTID)

func (NFTID) TokenID added in v1.0.3

func (n NFTID) TokenID() *big.Int

TokenID returns the uint256 tokenID for ERC721

func (NFTID) Unwrap

func (n NFTID) Unwrap() (ret iotago.NFTID)

type NativeToken

type NativeToken struct {
	ID     NativeTokenID
	Amount *big.Int
}

NativeToken matches the struct definition in ISCTypes.sol

func WrapNativeToken

func WrapNativeToken(nt *iotago.NativeToken) NativeToken

func (NativeToken) Unwrap

func (nt NativeToken) Unwrap() *iotago.NativeToken

type NativeTokenID

type NativeTokenID struct {
	Data []byte
}

NativeTokenID matches the struct definition in ISCTypes.sol

func WrapNativeTokenID

func WrapNativeTokenID(id *iotago.NativeTokenID) NativeTokenID

func (NativeTokenID) MustUnwrap added in v1.0.3

func (a NativeTokenID) MustUnwrap() (ret iotago.NativeTokenID)

func (NativeTokenID) Unwrap

func (a NativeTokenID) Unwrap() (ret iotago.NativeTokenID)

Jump to

Keyboard shortcuts

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