Skip to main content

TracedHashedMap

@opcat-labs/scrypt-ts-opcat v1.0.4


@opcat-labs/scrypt-ts-opcat / TracedHashedMap

Class: TracedHashedMap\<KeyType, ValueType, MaxAccessKeys>

Defined in: packages/scrypt-ts-opcat/src/smart-contract/builtin-libs/hashedMap/tracedHashedMap.ts:57

This class is a wrapper of the hashed map, only used to trace the access of the hashed map. when executing the smart contract unlock method, wrap the hashed map and trace the access, then extract the hashed map contract and inject it to bitcoin unlocking script.

This class is only used in this repo internally, do not use it outside this repo.

Type Parameters​

• KeyType extends PrimitiveTypes

• ValueType extends StructObject

• MaxAccessKeys extends number

Constructors​

new TracedHashedMap()​

new TracedHashedMap\<KeyType, ValueType, MaxAccessKeys>(beforeMap): TracedHashedMap\<KeyType, ValueType, MaxAccessKeys>

Defined in: packages/scrypt-ts-opcat/src/smart-contract/builtin-libs/hashedMap/tracedHashedMap.ts:66

Parameters​

beforeMap​

HashedMap\<KeyType, ValueType, MaxAccessKeys>

Returns​

TracedHashedMap\<KeyType, ValueType, MaxAccessKeys>

Properties​

afterMap​

afterMap: HashedMap\<KeyType, ValueType, MaxAccessKeys>

Defined in: packages/scrypt-ts-opcat/src/smart-contract/builtin-libs/hashedMap/tracedHashedMap.ts:63


beforeMap​

beforeMap: HashedMap\<KeyType, ValueType, MaxAccessKeys>

Defined in: packages/scrypt-ts-opcat/src/smart-contract/builtin-libs/hashedMap/tracedHashedMap.ts:62

Accessors​

genericType​

Get Signature​

get genericType(): object

Defined in: packages/scrypt-ts-opcat/src/smart-contract/builtin-libs/hashedMap/tracedHashedMap.ts:97

Returns​

object

keyType​

keyType: string

maxAccessKeys​

maxAccessKeys: number

valueType​

valueType: string

Methods​

emptyKey()​

emptyKey(): KeyType

Defined in: packages/scrypt-ts-opcat/src/smart-contract/builtin-libs/hashedMap/tracedHashedMap.ts:94

Returns​

KeyType


emptyValue()​

emptyValue(): ValueType

Defined in: packages/scrypt-ts-opcat/src/smart-contract/builtin-libs/hashedMap/tracedHashedMap.ts:91

Returns​

ValueType


extractContext()​

extractContext(): object

Defined in: packages/scrypt-ts-opcat/src/smart-contract/builtin-libs/hashedMap/tracedHashedMap.ts:115

Returns​

object

ctx​

ctx: HashedMapContext\<KeyType, ValueType, MaxAccessKeys>

operations​

operations: Operation\<KeyType, ValueType>[]


get()​

get(key): ValueType

Defined in: packages/scrypt-ts-opcat/src/smart-contract/builtin-libs/hashedMap/tracedHashedMap.ts:80

Parameters​

key​

KeyType

Returns​

ValueType


serializeKey()​

serializeKey(key): ByteString

Defined in: packages/scrypt-ts-opcat/src/smart-contract/builtin-libs/hashedMap/tracedHashedMap.ts:85

Parameters​

key​

KeyType

Returns​

ByteString


serializeValue()​

serializeValue(value): ByteString

Defined in: packages/scrypt-ts-opcat/src/smart-contract/builtin-libs/hashedMap/tracedHashedMap.ts:88

Parameters​

value​

ValueType

Returns​

ByteString


set()​

set(key, value): void

Defined in: packages/scrypt-ts-opcat/src/smart-contract/builtin-libs/hashedMap/tracedHashedMap.ts:75

Parameters​

key​

KeyType

value​

ValueType

Returns​

void