MCPcopy Create free account
hub / github.com/cardstack/cardstack / methodHashFromEncodedHex

Function methodHashFromEncodedHex

packages/cardpay-subgraph/src/abi.ts:89–94  ·  view source on GitHub ↗
(hex: string)

Source from the content-addressed store, hash-verified

87}
88
89export function methodHashFromEncodedHex(hex: string): string {
90 if (hex.startsWith('0x')) {
91 hex = hex.slice(2);
92 }
93 return toHex(hex.slice(0, 8));
94}
95
96export function encodeMethodSignature(methodSignature: string): string {
97 return crypto.keccak256(ByteArray.fromUTF8(methodSignature)).toHex().slice(0, 10);

Callers 1

handleExecutionSuccessFunction · 0.90

Calls 1

toHexFunction · 0.90

Tested by

no test coverage detected