methodSelector
Call Signature
Section titled “Call Signature”methodSelector(
methodSignature):bytes<4>
Defined in: arc4/index.ts:211
Returns the ARC4 method selector for a given ARC4 method signature. The method selector is the first 4 bytes of the SHA512/256 hash of the method signature.
Parameters
Section titled “Parameters”methodSignature
Section titled “methodSignature”InstanceMethod<Contract>
An ARC4 contract method reference. (Eg. MyContract.prototype.myMethod)
Returns
Section titled “Returns”bytes<4>
The ARC4 method selector. Eg. 02BECE11
Call Signature
Section titled “Call Signature”methodSelector(
methodSignature):bytes<4>
Defined in: arc4/index.ts:218
Returns the ARC4 method selector for a given ARC4 method signature. The method selector is the first 4 bytes of the SHA512/256 hash of the method signature.
Parameters
Section titled “Parameters”methodSignature
Section titled “methodSignature”string
An ARC4 method signature string (Eg. hello(string)string. Must be a compile time constant)
Returns
Section titled “Returns”bytes<4>
The ARC4 method selector. Eg. 02BECE11
Call Signature
Section titled “Call Signature”methodSelector<
TMethod>():bytes<4>
Defined in: arc4/index.ts:227
Returns the ARC4 method selector for a given ARC4 method signature. The method selector is the first 4 bytes of the SHA512/256 hash of the method signature.
Type Parameters
Section titled “Type Parameters”TMethod
Section titled “TMethod”TMethod
The type of an ARC4 method signature (eg. typeof MyContract.prototype.myMethod)
Returns
Section titled “Returns”bytes<4>
The ARC4 method selector. Eg. 02BECE11
Remarks
Section titled “Remarks”This overload can be used in conjunction with type only import (eg. import type { MyContract } from './my-contract') to
work around what would otherwise be a circular reference in the event two contracts need to call each other.