Skip to main content

OwnerUtils

@opcat-labs/cat-sdk v1.0.3


@opcat-labs/cat-sdk / OwnerUtils

Class: OwnerUtils

Defined in: packages/cat-sdk/src/contracts/utils/ownerUtils.ts:14

The owner utilities for the CAT contracts

Onchain​

Extends​

  • SmartContractLib

Constructors​

new OwnerUtils()​

new OwnerUtils(...args): OwnerUtils

Defined in: node_modules/@opcat-labs/scrypt-ts-opcat/dist/types/smart-contract/smartContractLib.d.ts:18

Parameters​

args​

...SupportedParamType[]

Returns​

OwnerUtils

Inherited from​

SmartContractLib.constructor

Properties​

args​

args: any[]

Defined in: node_modules/@opcat-labs/scrypt-ts-opcat/dist/types/smart-contract/smartContractLib.d.ts:17

Inherited from​

SmartContractLib.args


artifact​

static artifact: Artifact

Defined in: node_modules/@opcat-labs/scrypt-ts-opcat/dist/types/smart-contract/smartContractLib.d.ts:14

Inherited from​

SmartContractLib.artifact


stateType?​

static optional stateType: string

Defined in: node_modules/@opcat-labs/scrypt-ts-opcat/dist/types/smart-contract/smartContractLib.d.ts:15

Inherited from​

SmartContractLib.stateType

Methods​

checkOwnerAddr()​

static checkOwnerAddr(ownerAddr): void

Defined in: packages/cat-sdk/src/contracts/utils/ownerUtils.ts:42

Parameters​

ownerAddr​

ByteString

Returns​

void


checkPubKey()​

static checkPubKey(pubKey): void

Defined in: packages/cat-sdk/src/contracts/utils/ownerUtils.ts:37

Parameters​

pubKey​

ByteString

Returns​

void


checkUserOwner()​

static checkUserOwner(pubKey, ownerAddr): void

Defined in: packages/cat-sdk/src/contracts/utils/ownerUtils.ts:32

Check if the user public key matches the owner's address

Parameters​

pubKey​

ByteString

user public key

ownerAddr​

ByteString

owner address

Returns​

void


loadArtifact()​

static loadArtifact(artifact): typeof SmartContractLib

Defined in: node_modules/@opcat-labs/scrypt-ts-opcat/dist/types/smart-contract/smartContractLib.d.ts:16

Parameters​

artifact​

Artifact

Returns​

typeof SmartContractLib

Inherited from​

SmartContractLib.loadArtifact


serialize()​

static serialize(ownerAddr): ByteString

Defined in: packages/cat-sdk/src/contracts/utils/ownerUtils.ts:51

Parameters​

ownerAddr​

ByteString

Returns​

ByteString


toLockingScript()​

static toLockingScript(pubKey): ByteString

Defined in: packages/cat-sdk/src/contracts/utils/ownerUtils.ts:21

Convert public key to P2PKH locking script

Parameters​

pubKey​

ByteString

user public key

Returns​

ByteString

locking script