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 SplitOutputCell2(total, base, limit uint64, lockScript, typeScript *types.Script, ...) ([]*types.CellOutput, error)
- func UpdateAccountCellDasLockToEip712(cell *indexer.LiveCell) error
- type AnyLockName
- type ChainTypeAddress
- func (c *ChainTypeAddress) FormatChainTypeAddress(net common.DasNetType, is712 bool) (*DasAddressHex, error)
- func (c *ChainTypeAddress) FormatChainTypeAddressToScript(net common.DasNetType, is712 bool) (*types.Script, *types.Script, error)
- func (c *ChainTypeAddress) GetChainId(net common.DasNetType) (chainId int64)
- 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) AddPkIndexForSignMsg(signMsg *string, idx int)
- func (d *DasCore) AsyncDasConfigCell() error
- func (d *DasCore) CheckContractStatusOK(contractName common.DasContractName) (bool, error)
- func (d *DasCore) CheckContractVersion(contractName common.DasContractName) (defaultV, ChainV string, err error)
- func (d *DasCore) CheckContractVersionV2(systemStatus *witness.ConfigCellDataBuilder, ...) (defaultV, ChainV string, err 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) GetAccountCharSetList(account string) ([]common.AccountCharSet, error)
- func (d *DasCore) GetAnyLockCellDep(anyLockName AnyLockName) (*types.CellDep, error)
- func (d *DasCore) GetBalanceCellWithLock(p *ParamGetBalanceCells) (uint64, []*indexer.LiveCell, error)
- func (d *DasCore) GetBalanceCells(p *ParamGetBalanceCells) ([]*indexer.LiveCell, uint64, error)
- func (d *DasCore) GetBalanceCellsFilter(p *ParamGetBalanceCells) ([]*indexer.LiveCell, uint64, error)
- func (d *DasCore) GetCustomScriptLiveCell(data []byte) (*indexer.LiveCell, error)
- func (d *DasCore) GetDPBaseCapacity() (uint64, uint64, error)
- func (d *DasCore) GetDPointCapacityRecycleWhitelist() (map[string]*types.Script, error)
- func (d *DasCore) GetDPointTransferWhitelist() (map[string]*types.Script, error)
- func (d *DasCore) GetDasLock() *types.Script
- func (d *DasCore) GetDidCellOccupiedCapacity(lock *types.Script, account string) (uint64, error)
- func (d *DasCore) GetDpCells(p *ParamGetDpCells) ([]*indexer.LiveCell, uint64, uint64, error)
- func (d *DasCore) GetHeightCell() (*HeightCell, error)
- func (d *DasCore) GetHeightCellList() ([]*HeightCell, error)
- func (d *DasCore) GetIdxOfKeylist(loginAddr, signAddr DasAddressHex) (int, error)
- func (d *DasCore) GetIdxOfKeylistByOutPoint(LoginkeyListOp *types.OutPoint, signAddr DasAddressHex) (int, error)
- func (d *DasCore) GetInputsDPInfo(tx *types.Transaction) (map[string]TxDPInfo, error)
- func (d *DasCore) GetKeyListCell(args []byte) (*indexer.LiveCell, error)
- func (d *DasCore) GetOutputsDPInfo(tx *types.Transaction) (map[string]TxDPInfo, error)
- func (d *DasCore) GetQuoteCell() (*QuoteCell, error)
- func (d *DasCore) GetQuoteCellList() ([]*QuoteCell, error)
- func (d *DasCore) GetReverseRecordSmtCell() (*indexer.LiveCell, error)
- func (d *DasCore) GetSubAccountCell(parentAccountId string) (*indexer.LiveCell, error)
- func (d *DasCore) GetTimeCell() (*TimeCell, error)
- func (d *DasCore) GetTimeCellList() ([]*TimeCell, error)
- func (d *DasCore) GetTxQuote(tx *types.Transaction) (uint64, 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) SplitDPCell(p *ParamSplitDPCell) ([]*types.CellOutput, [][]byte, uint64, error)
- func (d *DasCore) TxToDidCellEntityAndAction(tx *types.Transaction) (common.DidCellAction, TxDidCellMap, error)
- func (d *DasCore) UpdateAccountCellDasLockToEip712(cell *indexer.LiveCell)
- type DasCoreOption
- type DidCellInfo
- type Env
- type HeightCell
- type KeyInfo
- type ParamGetBalanceCells
- type ParamGetDpCells
- type ParamSplitDPCell
- type QuoteCell
- type SoScript
- type TimeCell
- type TxDPInfo
- type TxDidCellMap
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 ContractStatusMapMainNet = map[common.DasContractName]common.ContractStatus{ common.DasContractNameApplyRegisterCellType: {Version: "1.1.0"}, common.DasContractNamePreAccountCellType: {Version: "1.5.0"}, common.DasContractNameProposalCellType: {Version: "1.4.0"}, common.DasContractNameConfigCellType: {Version: "1.1.2"}, common.DasContractNameAccountCellType: {Version: "1.11.0"}, common.DasContractNameAccountSaleCellType: {Version: "1.2.0"}, common.DASContractNameSubAccountCellType: {Version: "1.7.0"}, common.DASContractNameOfferCellType: {Version: "1.1.0"}, common.DasContractNameBalanceCellType: {Version: "1.3.0"}, common.DasContractNameIncomeCellType: {Version: "1.2.1"}, common.DasContractNameReverseRecordCellType: {Version: "1.1.0"}, common.DASContractNameEip712LibCellType: {Version: "1.3.0"}, common.DasContractNameReverseRecordRootCellType: {Version: "1.1.0"}, common.DasContractNameDpCellType: {Version: "1.0.0"}, }
View Source
var ContractStatusMapTestNet = map[common.DasContractName]common.ContractStatus{ common.DasContractNameApplyRegisterCellType: {Version: "1.1.0"}, common.DasContractNamePreAccountCellType: {Version: "1.5.1"}, common.DasContractNameProposalCellType: {Version: "1.4.0"}, common.DasContractNameConfigCellType: {Version: "1.1.2"}, common.DasContractNameAccountCellType: {Version: "1.11.0"}, common.DasContractNameAccountSaleCellType: {Version: "1.2.0"}, common.DASContractNameSubAccountCellType: {Version: "1.7.0"}, common.DASContractNameOfferCellType: {Version: "1.1.0"}, common.DasContractNameBalanceCellType: {Version: "1.3.0"}, common.DasContractNameIncomeCellType: {Version: "1.2.1"}, common.DasContractNameReverseRecordCellType: {Version: "1.1.0"}, common.DASContractNameEip712LibCellType: {Version: "1.3.0"}, common.DasContractNameReverseRecordRootCellType: {Version: "1.1.0"}, common.DasContractNameDpCellType: {Version: "1.0.0"}, }
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", common.DasContractNameReverseRecordRootCellType: "0x3bd4491a15b3c84de133f4d619f5f7317fe7df7098a5c8dfd0ff073e448321a7", common.DasKeyListCellType: "0x97e271bfd332cc2e68feb6a4fa21a1dc010c53011d02d9acdbfc4d417d8efadd", common.DasContractNameDpCellType: "0x5aa67507980f2bfdef75bf4f14caf886202f044d84fb4300858c9c823e3bb651", common.DasContractNameDidCellType: "0x62312cd846659e188b05da11dc3f080b083c27371ea701d6026e11e713e0e3de", }, MapSoScript: map[common.SoScriptType]string{ common.SoScriptTypeEd25519: "0xac4689bcb177af6ff0fee8c0c3bf0d8803b263381a5d5b22f1ca1b687eb5eb4a", common.SoScriptTypeEth: "0x748005446caeda5b04e30bca42a65bb0b5275d2bd02694f08ecb8d3d07c41433", common.SoScriptTypeTron: "0xb29620c50fd4fde746eae4d27e40b42d0900d1718fbf25ecae704e6a693215db", common.SoScriptTypeCkbMulti: "0xab8a94c35890712763c70130db080fbbb7fe99ec74e7c87e4fdd44f4a6155646", common.SoScriptTypeCkbSingle: "0x4eed7961fdeaa659aa9ff59a242a2bc40f63dc043c1eba44c207ee6e05e02e9f", common.SoScriptTypeDogeCoin: "0x2388d84e42714e51cbb1a60c4ab2df3321c632a204b7d963d7f9b89a50ceaa3c", common.SoScriptWebauthn: "0x3dd5981ead36572330cc90b0bd4795062483392bfeea09f6ff8f02c830988998", common.SoScriptBitcoin: "0xbeeb821fccb98acb8713cd0702c2d74729909222608ee78be42c6a15c1eb2014", }, }
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", common.DasContractNameReverseRecordRootCellType: "0xd7dbb55237fca8aa544d160e26a22424b4edc6b9ce136994df977fa057e468ae", common.DasKeyListCellType: "0xf80a65bd78e54f66614eb5d17c980e66c1944e7808510b6f08bb46ae5407147c", common.DasContractNameDpCellType: "0xf5af4173248dbeaf4a54d1aa93958e094b98c90400be92bb2b1daa61dfc37785", common.DasContractNameDidCellType: "0x80f0d4bf6b3951911aa6b98cc609d477a8a10b903b35cfd528d098e95c36f680", }, MapSoScript: map[common.SoScriptType]string{ common.SoScriptTypeEd25519: "0x6cd3e59963ebd6aec1ee99968f2ec418ced3273ad636a561cd5459836c903c2d", common.SoScriptTypeEth: "0x644ead361f2a2fe32431a81489a7a0f8d7332ba17918ab5184461d588f011a82", common.SoScriptTypeTron: "0x2df08d17fe6ff0994b741344fe62e100b7576c31e006f8bc83d26f26ede8d82e", common.SoScriptTypeCkbMulti: "0x393ac0be9d3bf4a282d2cf0b80a4a910206b87451fc6a3fb04d176f3d0c1f73a", common.SoScriptTypeCkbSingle: "0x249b06f89e76f98cebcd945bea47926d6ff88908cbbc8be2ccfb0a915e349b21", common.SoScriptTypeDogeCoin: "0x4d801e313bca5426c254fb9ac73fcdb79f9eee216a911ec39526a00e3379f496", common.SoScriptWebauthn: "0xe8e93df527c7dd6f4deb2d5ac3a071649f5794a4ed8d565adca74e7bee634c48", common.SoScriptBitcoin: "0xaaa8f5e85e59392a3c26eb0533851efaf9daf8793349a2d117025d6b474be3fa", }, }
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", common.DasContractNameReverseRecordRootCellType: "0xeb54ad6c4be167c902470c4fe9b04a4d8e2b5ef46f4b2725e814518d7baa15ca", common.DasKeyListCellType: "0x449bb468a1fefb93e5b034a070d46e6772fcd25712dc56fc8bcc191b4433f1a0", common.DasContractNameDpCellType: "", common.DasContractNameDidCellType: "", }, MapSoScript: map[common.SoScriptType]string{ common.SoScriptTypeEd25519: "0x6cd3e59963ebd6aec1ee99968f2ec418ced3273ad636a561cd5459836c903c2d", common.SoScriptTypeEth: "0x644ead361f2a2fe32431a81489a7a0f8d7332ba17918ab5184461d588f011a82", common.SoScriptTypeTron: "0x2df08d17fe6ff0994b741344fe62e100b7576c31e006f8bc83d26f26ede8d82e", common.SoScriptTypeCkbMulti: "0x393ac0be9d3bf4a282d2cf0b80a4a910206b87451fc6a3fb04d176f3d0c1f73a", common.SoScriptTypeCkbSingle: "0x249b06f89e76f98cebcd945bea47926d6ff88908cbbc8be2ccfb0a915e349b21", common.SoScriptTypeDogeCoin: "0x4d801e313bca5426c254fb9ac73fcdb79f9eee216a911ec39526a00e3379f496", common.SoScriptWebauthn: "0xe8e93df527c7dd6f4deb2d5ac3a071649f5794a4ed8d565adca74e7bee634c48", }, }
View Source
var ErrContractMajorVersionDiff = errors.New("the major version of the contract is different")
View Source
var SubAccountNotFound = errors.New("sub-account not found")
Functions ¶
func SetLogLevel ¶
func SetLogLevel(level int)
func SplitOutputCell ¶
func SplitOutputCell2 ¶ added in v1.0.1
func SplitOutputCell2(total, base, limit uint64, lockScript, typeScript *types.Script, splitOrder indexer.SearchOrder) ([]*types.CellOutput, error)
Types ¶
type AnyLockName ¶ added in v1.2.0
type AnyLockName string
const ( AnyLockNameOmniLock AnyLockName = "omni-lock" AnyLockNameJoyID AnyLockName = "joyid" AnyLockNameNoStr AnyLockName = "nostr" )
type ChainTypeAddress ¶
type ChainTypeAddress struct { Type string `json:"type"` // blockchain KeyInfo KeyInfo `json:"key_info"` }
func FormatChainTypeAddress ¶ added in v1.1.0
func FormatChainTypeAddress(net common.DasNetType, chainType common.ChainType, key string) ChainTypeAddress
func (*ChainTypeAddress) FormatChainTypeAddress ¶
func (c *ChainTypeAddress) FormatChainTypeAddress(net common.DasNetType, is712 bool) (*DasAddressHex, error)
func (*ChainTypeAddress) FormatChainTypeAddressToScript ¶ added in v1.1.0
func (c *ChainTypeAddress) FormatChainTypeAddressToScript(net common.DasNetType, is712 bool) (*types.Script, *types.Script, error)
func (*ChainTypeAddress) GetChainId ¶ added in v1.2.0
func (c *ChainTypeAddress) GetChainId(net common.DasNetType) (chainId int64)
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 DasAddressHex struct { DasAlgorithmId common.DasAlgorithmId DasSubAlgorithmId common.DasSubAlgorithmId AddressHex string AddressPayload []byte IsMulti bool ChainType common.ChainType // format normal address ckb chain type ParsedAddress *address.ParsedAddress }
func (*DasAddressHex) FormatAnyLock ¶ added in v1.2.0
func (d *DasAddressHex) FormatAnyLock() (*DasAddressHex, error)
func (*DasAddressHex) Payload ¶ added in v1.2.0
func (d *DasAddressHex) Payload() string
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) AddPkIndexForSignMsg ¶ added in v1.1.0
func (*DasCore) AsyncDasConfigCell ¶
func (*DasCore) CheckContractStatusOK ¶ added in v1.0.1
func (d *DasCore) CheckContractStatusOK(contractName common.DasContractName) (bool, error)
func (*DasCore) CheckContractVersion ¶ added in v1.0.1
func (d *DasCore) CheckContractVersion(contractName common.DasContractName) (defaultV, ChainV string, err error)
func (*DasCore) CheckContractVersionV2 ¶ added in v1.0.1
func (d *DasCore) CheckContractVersionV2(systemStatus *witness.ConfigCellDataBuilder, contractName common.DasContractName) (defaultV, ChainV string, err error)
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) GetAccountCharSetList ¶ added in v1.0.1
func (d *DasCore) GetAccountCharSetList(account string) ([]common.AccountCharSet, error)
func (*DasCore) GetAnyLockCellDep ¶ added in v1.2.0
func (d *DasCore) GetAnyLockCellDep(anyLockName AnyLockName) (*types.CellDep, error)
func (*DasCore) GetBalanceCellWithLock ¶ added in v1.2.0
func (*DasCore) GetBalanceCells ¶
func (*DasCore) GetBalanceCellsFilter ¶ added in v1.2.0
func (*DasCore) GetCustomScriptLiveCell ¶
func (*DasCore) GetDPBaseCapacity ¶ added in v1.2.0
func (*DasCore) GetDPointCapacityRecycleWhitelist ¶ added in v1.2.0
func (*DasCore) GetDPointTransferWhitelist ¶ added in v1.2.0
func (*DasCore) GetDasLock ¶
func (*DasCore) GetDidCellOccupiedCapacity ¶ added in v1.2.0
func (*DasCore) GetDpCells ¶ added in v1.2.0
func (*DasCore) GetHeightCell ¶
func (d *DasCore) GetHeightCell() (*HeightCell, error)
func (*DasCore) GetHeightCellList ¶ added in v1.0.1
func (d *DasCore) GetHeightCellList() ([]*HeightCell, error)
func (*DasCore) GetIdxOfKeylist ¶ added in v1.1.0
func (d *DasCore) GetIdxOfKeylist(loginAddr, signAddr DasAddressHex) (int, error)
func (*DasCore) GetIdxOfKeylistByOutPoint ¶ added in v1.1.0
func (*DasCore) GetInputsDPInfo ¶ added in v1.2.0
func (*DasCore) GetKeyListCell ¶ added in v1.1.0
func (*DasCore) GetOutputsDPInfo ¶ added in v1.2.0
func (*DasCore) GetQuoteCell ¶
func (*DasCore) GetQuoteCellList ¶ added in v1.0.1
func (*DasCore) GetReverseRecordSmtCell ¶ added in v1.0.1
func (*DasCore) GetSubAccountCell ¶
func (*DasCore) GetTimeCell ¶
func (*DasCore) GetTimeCellList ¶ added in v1.0.1
func (*DasCore) GetTxQuote ¶ added in v1.2.0
func (d *DasCore) GetTxQuote(tx *types.Transaction) (uint64, error)
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) SplitDPCell ¶ added in v1.2.0
func (d *DasCore) SplitDPCell(p *ParamSplitDPCell) ([]*types.CellOutput, [][]byte, uint64, error)
func (*DasCore) TxToDidCellEntityAndAction ¶ added in v1.2.0
func (d *DasCore) TxToDidCellEntityAndAction(tx *types.Transaction) (common.DidCellAction, TxDidCellMap, error)
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 DidCellInfo ¶ added in v1.2.0
type DidCellInfo struct { Index uint64 OutPoint *types.OutPoint Lock *types.Script OutputsData []byte }
func (*DidCellInfo) GetDataInfo ¶ added in v1.2.0
func (d *DidCellInfo) GetDataInfo() (*witness.SporeData, *witness.DidCellDataLV, error)
func (*DidCellInfo) GetLockAddress ¶ added in v1.2.0
func (d *DidCellInfo) GetLockAddress(netType common.DasNetType) (string, error)
type Env ¶
type Env struct { THQCodeHash string ContractArgs string ContractCodeHash string MapContract map[common.DasContractName]string MapSoScript map[common.SoScriptType]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 ParamGetDpCells ¶ added in v1.2.0
type ParamSplitDPCell ¶ added in v1.2.0
type SoScript ¶
type SoScript struct { Name common.SoScriptType OutPoint types.OutPoint SoScriptArgs string }
func GetDasSoScript ¶
func GetDasSoScript(soScriptName common.SoScriptType) (*SoScript, error)
type TxDPInfo ¶ added in v1.2.0
type TxDPInfo struct { AlgId common.DasAlgorithmId `json:"alg_id"` SubAlgId common.DasSubAlgorithmId `json:"sub_alg_id"` Payload string `json:"payload"` AmountDP uint64 `json:"amount_dp"` Args []byte `json:"args"` }
type TxDidCellMap ¶ added in v1.2.0
type TxDidCellMap struct { Inputs map[string]DidCellInfo Outputs map[string]DidCellInfo }
Click to show internal directories.
Click to hide internal directories.