Documentation ¶
Index ¶
- Variables
- func GetSatisfiedCapacityLiveCell(client rpc.Client, dasCache *dascache.DasCache, ...) ([]*indexer.LiveCell, uint64, error)
- func GetSatisfiedCapacityLiveCellWithOrder(client rpc.Client, dasCache *dascache.DasCache, ...) ([]*indexer.LiveCell, uint64, error)
- func GetSatisfiedLimitLiveCell(client rpc.Client, dasCache *dascache.DasCache, searchKey *indexer.SearchKey, ...) ([]*indexer.LiveCell, error)
- func SetLogLevel(level int)
- func SplitOutputCell(total, base, limit uint64, lockScript, typeScript *types.Script) ([]*types.CellOutput, error)
- func UpdateAccountCellDasLockToEip712(cell *indexer.LiveCell) error
- type ChainTypeAddress
- type DasAddressFormat
- func (d *DasAddressFormat) ArgsToHex(args []byte) (ownerHex, managerHex DasAddressHex, e error)
- func (d *DasAddressFormat) ArgsToNormal(args []byte) (ownerNormal, managerNormal DasAddressNormal, e error)
- func (d *DasAddressFormat) HexToArgs(owner, manager DasAddressHex) (args []byte, e error)
- func (d *DasAddressFormat) HexToHalfArgs(p DasAddressHex) (args []byte, e error)
- func (d *DasAddressFormat) HexToNormal(p DasAddressHex) (r DasAddressNormal, e error)
- func (d *DasAddressFormat) HexToScript(p DasAddressHex) (lockScript, typeScript *types.Script, e error)
- func (d *DasAddressFormat) NormalToHex(p DasAddressNormal) (r DasAddressHex, e error)
- func (d *DasAddressFormat) ScriptToHex(s *types.Script) (ownerHex, managerHex DasAddressHex, e error)
- type DasAddressHex
- type DasAddressNormal
- type DasConfigCellInfo
- type DasContractInfo
- type DasCore
- func (d *DasCore) AsyncDasConfigCell() error
- func (d *DasCore) Client() rpc.Client
- func (d *DasCore) ConfigCellDataBuilderByTypeArgs(configCellTypeArgs common.ConfigCellTypeArgs) (*witness.ConfigCellDataBuilder, error)
- func (d *DasCore) ConfigCellDataBuilderByTypeArgsList(list ...common.ConfigCellTypeArgs) (*witness.ConfigCellDataBuilder, error)
- func (d *DasCore) Daf() *DasAddressFormat
- func (d *DasCore) GetAccountCellOnChainByAlgorithmId(oID, mID common.DasAlgorithmId, oA, mA, account string) (*indexer.LiveCell, error)
- func (d *DasCore) GetBalanceCells(p *ParamGetBalanceCells) ([]*indexer.LiveCell, uint64, error)
- func (d *DasCore) GetCustomScriptLiveCell(data []byte) (*indexer.LiveCell, error)
- func (d *DasCore) GetDasLock() *types.Script
- func (d *DasCore) GetHeightCell() (*HeightCell, error)
- func (d *DasCore) GetQuoteCell() (*QuoteCell, error)
- func (d *DasCore) GetSubAccountCell(parentAccountId string) (*indexer.LiveCell, error)
- func (d *DasCore) GetTimeCell() (*TimeCell, error)
- func (d *DasCore) InitDasConfigCell() error
- func (d *DasCore) InitDasContract(mapDasContractTypeArgs map[common.DasContractName]string)
- func (d *DasCore) InitDasSoScript() error
- func (d *DasCore) NetType() common.DasNetType
- func (d *DasCore) RunAsyncDasConfigCell(t time.Duration)
- func (d *DasCore) RunAsyncDasContract(t time.Duration)
- func (d *DasCore) RunAsyncDasSoScript(t time.Duration)
- func (d *DasCore) UpdateAccountCellDasLockToEip712(cell *indexer.LiveCell)
- type DasCoreOption
- type Env
- type HeightCell
- type KeyInfo
- type ParamGetBalanceCells
- type QuoteCell
- type SoScript
- type TimeCell
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrRejectedOutPoint = errors.New("RejectedOutPoint") ErrInsufficientFunds = errors.New("InsufficientFunds") ErrNotEnoughChange = errors.New("NotEnoughChange") )
View Source
var ( DasContractMap syncmap.Map // map[contact name]{contract info} DasContractByTypeIdMap = make(map[string]common.DasContractName) // map[contract type id]{contract name} DasConfigCellMap syncmap.Map // map[ConfigCellTypeArgs]config cell info DasConfigCellByTxHashMap syncmap.Map // map[tx hash]{true} DasSoScriptMap syncmap.Map // map[so script type] )
View Source
var EnvMainNet = Env{ THQCodeHash: "0x9e537bf5b8ec044ca3f53355e879f3fd8832217e4a9b41d9994cf0c547241a79", ContractArgs: "0xc126635ece567c71c50f7482c5db80603852c306", ContractCodeHash: "0x00000000000000000000000000000000000000000000000000545950455f4944", MapContract: map[common.DasContractName]string{ common.DasContractNameConfigCellType: "0x3775c65aabe8b79980c4933dd2f4347fa5ef03611cef64328685618aa7535794", common.DasContractNameAccountCellType: "0x96dc231bbbee6aa474076468640f9e0ad27cf13b1343716a7ce04b116ea18ba8", common.DasContractNameBalanceCellType: "0xbdc8f42643ccad23e8df3d2e8dbdea9201812cd1b7f84c46e69b020529629822", common.DasContractNameDispatchCellType: "0xda22fd296682488687a6035b5fc97c269b72d7de128034389bd03041b40309c0", common.DasContractNameIncomeCellType: "0x108fba6a9b9f2898b4cdf11383ba2a6ed3da951b458c48e5f5de0353bbca2d46", common.DasContractNameAccountSaleCellType: "0xb782d5f4e24603340997494871ba8f7d175e6920e63ead6b8137170b2e370469", common.DasContractNameAlwaysSuccess: "0xca5016f232830f8a73e6827b5e1108aca68e7cf8baea4847ac40ef1da43c4c50", common.DasContractNameApplyRegisterCellType: "0xf18c3eab9fd28adbb793c38be9a59864989c1f739c22d2b6dc3f4284f047a69d", common.DasContractNamePreAccountCellType: "0xf6574955079797010689a22cd172ce55b52d2c34d1e9bc6596e97babc2906f7e", common.DasContractNameProposalCellType: "0xd7b779b1b30f86a77db6b292c9492906f2437b7d88a8a5994e722619bb1d41c8", common.DasContractNameReverseRecordCellType: "0x000f3e1a89d85d268ed6d36578d474ecf91d8809f4f696dd2e5b97fe67b84a2e", common.DASContractNameOfferCellType: "0x3ffc0f8b0ce4bc09f700ca84355a092447d79fc5224a6fbd64af95af840af91b", common.DASContractNameSubAccountCellType: "0x97b19f14184f24d55b1247596a5d7637f133c7bb7735f0ae962dc709c5fc1e2e", common.DASContractNameEip712LibCellType: "0xa71fc12ca4ce4127dc911dbe8006f1907c850957849e282ef1f26e3ee50ba7bf", }, }
View Source
var EnvTestnet2 = Env{ THQCodeHash: "0x96248cdefb09eed910018a847cfb51ad044c2d7db650112931760e3ef34a7e9a", ContractArgs: "0xbc502a34a430e3e167c82a24db6f9237b15ebf35", ContractCodeHash: "0x00000000000000000000000000000000000000000000000000545950455f4944", MapContract: map[common.DasContractName]string{ common.DasContractNameConfigCellType: "0x34363fad2018db0b3b6919c26870f302da74c3c4ef4456e5665b82c4118eda51", common.DasContractNameAccountCellType: "0x6f0b8328b703617508d62d1f017b0d91fab2056de320a7b7faed4c777a356b7b", common.DasContractNameBalanceCellType: "0x27560fe2daa6150b771621300d1d4ea127832b7b326f2d70eed63f5333b4a8a9", common.DasContractNameDispatchCellType: "0xeedd10c7d8fee85c119daf2077fea9cf76b9a92ddca546f1f8e0031682e65aee", common.DasContractNameIncomeCellType: "0xd7b9d8213671aec03f3a3ab95171e0e79481db2c084586b9ea99914c00ff3716", common.DasContractNameAccountSaleCellType: "0xed5d7fc00a3f8605bfe3f6717747bb0ed529fa064c2b8ce56e9677a0c46c2c1c", common.DasContractNameAlwaysSuccess: "0x7821c662b7efd50e7f6cf2b036efe53e07eccaf2e3447a2a470ee07ae455ab92", common.DasContractNameApplyRegisterCellType: "0xc78fa9066af1624e600ccfb21df9546f900b2afe5d7940d91aefc115653f90d9", common.DasContractNamePreAccountCellType: "0xd3f7ad59632a2ebdc2fe9d41aa69708ed1069b074cd8b297b205f835335d3a6b", common.DasContractNameProposalCellType: "0x03d0bb128bd10e666975d9a07c148f6abebe811f511e9574048b30600b065b9a", common.DasContractNameReverseRecordCellType: "0x334d7841eb156b8aa5abd7b09277e91e782d840140905496bb5bff0ea6ce9d75", common.DASContractNameOfferCellType: "0x443b2d1b3b00ffab1a2287d84c47b2c31a11aad24b183d732c213a69e3d6d390", common.DASContractNameSubAccountCellType: "0x63ca3e26cc69809f06735c6d9139ec2d84f2a277f13509a54060d6ee19423b5b", common.DASContractNameEip712LibCellType: "0x16549cab7e92afb5f157141bc9da7781ce692a3144e47e2b8879a8d5a57b87c6", }, }
View Source
var EnvTestnet3 = Env{ THQCodeHash: "0x96248cdefb09eed910018a847cfb51ad044c2d7db650112931760e3ef34a7e9a", ContractArgs: "0xbc502a34a430e3e167c82a24db6f9237b15ebf35", ContractCodeHash: "0x00000000000000000000000000000000000000000000000000545950455f4944", MapContract: map[common.DasContractName]string{ common.DasContractNameConfigCellType: "0xe9fa679290f63ba1debc74f04e96f299d1b61a03a24e7a1a51c7ccad416ec16a", common.DasContractNameAccountCellType: "0x1c7d62798d412351ec9a4262aacc2c2837712b780d90e0720051ffa6d6304e32", common.DasContractNameBalanceCellType: "0x301127f501c2620174b60945f305d78a4f5cdf67dd44009001265ca133d0088d", common.DasContractNameDispatchCellType: "0xeedd10c7d8fee85c119daf2077fea9cf76b9a92ddca546f1f8e0031682e65aee", common.DasContractNameIncomeCellType: "0x0af1f2332b1f742136ef0ffec849d415c4b5b8c4426de5d245f2e7ac0a9f5773", common.DasContractNameAccountSaleCellType: "0xaf446d756fca5b51fad915a3f0526221527f1dd5f32898408ee86e73dc9d9814", common.DasContractNameAlwaysSuccess: "0x7821c662b7efd50e7f6cf2b036efe53e07eccaf2e3447a2a470ee07ae455ab92", common.DasContractNameApplyRegisterCellType: "0xb12e454a3896b910030e669e8a81bf99c351cb58be8d1529e1c7023265db6084", common.DasContractNamePreAccountCellType: "0x919e8036ded6670b923958db207527b5d1d3b95955e446e3475bfd7f949898c1", common.DasContractNameProposalCellType: "0x2eecc2c70936609d14872acdedc9ba8b265c26240d49d66b6db027c5cfdb4256", common.DasContractNameReverseRecordCellType: "0x80963278cbdc61cdafd5250555984b71ad016798b8879adc0e6b1ee7e01b7912", common.DASContractNameOfferCellType: "0xc69186c17e41fead0f87eb1f94829778e98a398be202655ac59fdb9567d05bae", common.DASContractNameSubAccountCellType: "0x57498a2df0c0137146ced681fa1854599e404da5804c1a5ff45d954c3cc89bfd", common.DASContractNameEip712LibCellType: "0xd21b1f02b6057d6776bf7f1c7a26f550f1b383a930349620507f328e4cc07f2e", }, }
Functions ¶
func SetLogLevel ¶
func SetLogLevel(level int)
func SplitOutputCell ¶
Types ¶
type ChainTypeAddress ¶
type ChainTypeAddress struct { Type string `json:"type"` // blockchain KeyInfo KeyInfo `json:"key_info"` }
func (*ChainTypeAddress) FormatChainTypeAddress ¶
func (c *ChainTypeAddress) FormatChainTypeAddress(net common.DasNetType, is712 bool) (*DasAddressHex, error)
type DasAddressFormat ¶
type DasAddressFormat struct {
DasNetType common.DasNetType
}
func (*DasAddressFormat) ArgsToHex ¶
func (d *DasAddressFormat) ArgsToHex(args []byte) (ownerHex, managerHex DasAddressHex, e error)
only for .bit args
func (*DasAddressFormat) ArgsToNormal ¶
func (d *DasAddressFormat) ArgsToNormal(args []byte) (ownerNormal, managerNormal DasAddressNormal, e error)
only for .bit args
func (*DasAddressFormat) HexToArgs ¶
func (d *DasAddressFormat) HexToArgs(owner, manager DasAddressHex) (args []byte, e error)
only for .bit hex address
func (*DasAddressFormat) HexToHalfArgs ¶
func (d *DasAddressFormat) HexToHalfArgs(p DasAddressHex) (args []byte, e error)
only for .bit hex address
func (*DasAddressFormat) HexToNormal ¶
func (d *DasAddressFormat) HexToNormal(p DasAddressHex) (r DasAddressNormal, e error)
only for .bit hex address
func (*DasAddressFormat) HexToScript ¶
func (d *DasAddressFormat) HexToScript(p DasAddressHex) (lockScript, typeScript *types.Script, e error)
only for .bit hex address
func (*DasAddressFormat) NormalToHex ¶
func (d *DasAddressFormat) NormalToHex(p DasAddressNormal) (r DasAddressHex, e error)
only for .bit normal address
func (*DasAddressFormat) ScriptToHex ¶
func (d *DasAddressFormat) ScriptToHex(s *types.Script) (ownerHex, managerHex DasAddressHex, e error)
for .bit or normal ckb script
type DasAddressHex ¶
type DasAddressNormal ¶
type DasConfigCellInfo ¶
config cell info
func GetDasConfigCellInfo ¶
func GetDasConfigCellInfo(configCellTypeArgs common.ConfigCellTypeArgs) (*DasConfigCellInfo, error)
func (*DasConfigCellInfo) ToCellDep ¶
func (d *DasConfigCellInfo) ToCellDep() *types.CellDep
type DasContractInfo ¶
type DasContractInfo struct { ContractName common.DasContractName OutPoint *types.OutPoint // contract outpoint OutPut *types.CellOutput // contract script ContractTypeId types.Hash // contract type id }
func GetDasContractInfo ¶
func GetDasContractInfo(contractName common.DasContractName) (*DasContractInfo, error)
func (*DasContractInfo) IsSameTypeId ¶
func (d *DasContractInfo) IsSameTypeId(codeHash types.Hash) bool
func (*DasContractInfo) ToCellDep ¶
func (d *DasContractInfo) ToCellDep() *types.CellDep
type DasCore ¶
type DasCore struct {
// contains filtered or unexported fields
}
func NewDasCore ¶
func (*DasCore) AsyncDasConfigCell ¶
func (*DasCore) ConfigCellDataBuilderByTypeArgs ¶
func (d *DasCore) ConfigCellDataBuilderByTypeArgs(configCellTypeArgs common.ConfigCellTypeArgs) (*witness.ConfigCellDataBuilder, error)
func (*DasCore) ConfigCellDataBuilderByTypeArgsList ¶
func (d *DasCore) ConfigCellDataBuilderByTypeArgsList(list ...common.ConfigCellTypeArgs) (*witness.ConfigCellDataBuilder, error)
func (*DasCore) Daf ¶
func (d *DasCore) Daf() *DasAddressFormat
func (*DasCore) GetAccountCellOnChainByAlgorithmId ¶
func (*DasCore) GetBalanceCells ¶
func (*DasCore) GetCustomScriptLiveCell ¶
func (*DasCore) GetDasLock ¶
func (*DasCore) GetHeightCell ¶
func (d *DasCore) GetHeightCell() (*HeightCell, error)
func (*DasCore) GetQuoteCell ¶
func (*DasCore) GetSubAccountCell ¶
func (*DasCore) GetTimeCell ¶
func (*DasCore) InitDasConfigCell ¶
func (*DasCore) InitDasContract ¶
func (d *DasCore) InitDasContract(mapDasContractTypeArgs map[common.DasContractName]string)
func (*DasCore) InitDasSoScript ¶
func (*DasCore) NetType ¶
func (d *DasCore) NetType() common.DasNetType
func (*DasCore) RunAsyncDasConfigCell ¶
func (*DasCore) RunAsyncDasContract ¶
update contract info
func (*DasCore) RunAsyncDasSoScript ¶
func (*DasCore) UpdateAccountCellDasLockToEip712 ¶
type DasCoreOption ¶
type DasCoreOption func(*DasCore)
func WithClient ¶
func WithClient(client rpc.Client) DasCoreOption
func WithDasContractArgs ¶
func WithDasContractArgs(dasContractArgs string) DasCoreOption
func WithDasContractCodeHash ¶
func WithDasContractCodeHash(dasContractCodeHash string) DasCoreOption
func WithDasNetType ¶
func WithDasNetType(net common.DasNetType) DasCoreOption
func WithTHQCodeHash ¶
func WithTHQCodeHash(thqCodeHash string) DasCoreOption
type Env ¶
type Env struct { THQCodeHash string ContractArgs string ContractCodeHash string MapContract map[common.DasContractName]string }
func InitEnv ¶
func InitEnv(net common.DasNetType) Env
func InitEnvOpt ¶
func InitEnvOpt(net common.DasNetType, names ...common.DasContractName) Env
type HeightCell ¶
func (*HeightCell) BlockNumber ¶
func (t *HeightCell) BlockNumber() int64
func (*HeightCell) ToCellDep ¶
func (t *HeightCell) ToCellDep() *types.CellDep
type ParamGetBalanceCells ¶
type SoScript ¶
type SoScript struct { Name common.SoScriptType OutPoint types.OutPoint }
func GetDasSoScript ¶
func GetDasSoScript(soScriptName common.SoScriptType) (*SoScript, error)
Click to show internal directories.
Click to hide internal directories.