HashedMap
@opcat-labs/scrypt-ts-opcat v1.0.4
@opcat-labs/scrypt-ts-opcat / HashedMap
Class: HashedMap\<KeyType, ValueType, MaxAccessKeys>
Defined in: packages/scrypt-ts-opcat/src/smart-contract/builtin-libs/hashedMap/hashedMap.ts:35
Extends
AnotherMap\<KeyType,ValueType>
Type Parameters
• KeyType extends PrimitiveTypes
• ValueType extends SupportedParamType
• MaxAccessKeys extends number
Constructors
new HashedMap()
new HashedMap\<
KeyType,ValueType,MaxAccessKeys>(pairs):HashedMap\<KeyType,ValueType,MaxAccessKeys>
Defined in: packages/scrypt-ts-opcat/src/smart-contract/builtin-libs/hashedMap/hashedMap.ts:65
create/initialize a hashed map with the pairs
Parameters
pairs
[KeyType, ValueType][]
The pairs of the map
Returns
HashedMap\<KeyType, ValueType, MaxAccessKeys>
Overrides
AnotherMap<KeyType, ValueType>.constructor
Properties
__hashed_map_dummy_key__
protected__hashed_map_dummy_key__:KeyType
Defined in: packages/scrypt-ts-opcat/src/smart-contract/builtin-libs/hashedMap/hashedMap.ts:219
__hashed_map_dummy_max_access_keys__
protected__hashed_map_dummy_max_access_keys__:MaxAccessKeys
Defined in: packages/scrypt-ts-opcat/src/smart-contract/builtin-libs/hashedMap/hashedMap.ts:221
__hashed_map_dummy_value__
protected__hashed_map_dummy_value__:ValueType
Defined in: packages/scrypt-ts-opcat/src/smart-contract/builtin-libs/hashedMap/hashedMap.ts:220
genericType
genericType:
object
Defined in: packages/scrypt-ts-opcat/src/smart-contract/builtin-libs/hashedMap/hashedMap.ts:41
keyType
keyType:
string
maxAccessKeys
maxAccessKeys:
number
valueType
valueType:
string
DUMMY_EMPTY_ROOT
readonlystaticDUMMY_EMPTY_ROOT:string
Defined in: packages/scrypt-ts-opcat/src/smart-contract/builtin-libs/hashedMap/hashedMap.ts:49
Methods
assertAttached()
assertAttached():
void
Defined in: packages/scrypt-ts-opcat/src/smart-contract/builtin-libs/hashedMap/hashedMap.ts:207
Returns
void
clear()
clear():
void
Defined in: packages/scrypt-ts-opcat/src/smart-contract/builtin-libs/hashedMap/hashedMap.ts:27
Returns
void
Inherited from
AnotherMap.clear
deserializeKey()
deserializeKey(
bytes):KeyType
Defined in: packages/scrypt-ts-opcat/src/smart-contract/builtin-libs/hashedMap/hashedMap.ts:169
Parameters
bytes
Returns
KeyType
deserializeValue()
deserializeValue(
bytes):ValueType
Defined in: packages/scrypt-ts-opcat/src/smart-contract/builtin-libs/hashedMap/hashedMap.ts:183
Parameters
bytes
Returns
ValueType
entries()
entries():
IterableIterator\<[KeyType,ValueType]>
Defined in: packages/scrypt-ts-opcat/src/smart-contract/builtin-libs/hashedMap/hashedMap.ts:30
Returns
IterableIterator\<[KeyType, ValueType]>
Inherited from
AnotherMap.entries
get()
get(
key):ValueType
Defined in: packages/scrypt-ts-opcat/src/smart-contract/builtin-libs/hashedMap/hashedMap.ts:77
Can call it inside a @method function
Parameters
key
KeyType
Returns
ValueType
Overrides
AnotherMap.get
serializedEntries()
serializedEntries(): [
ByteString,ByteString][]
Defined in: packages/scrypt-ts-opcat/src/smart-contract/builtin-libs/hashedMap/hashedMap.ts:213
Returns
[ByteString, ByteString][]
set()
set(
key,value):void
Defined in: packages/scrypt-ts-opcat/src/smart-contract/builtin-libs/hashedMap/hashedMap.ts:84
Can call it inside a @method function
Parameters
key
KeyType
value
ValueType
Returns
void
Overrides
AnotherMap.set
attachToState()
staticattachToState(state,contractOrLib):void
Defined in: packages/scrypt-ts-opcat/src/smart-contract/builtin-libs/hashedMap/hashedMap.ts:56
attach all the hashedmap fields in the state to it's artifact
Parameters
state
any
contractOrLib
typeof AbstractContract | typeof SmartContractLib
Returns
void