MCPcopy Create free account
hub / github.com/ccxt/ccxt / writeBytes

Method writeBytes

ts/src/static_dependencies/ethers/coders/abstract-coder.ts:378–385  ·  view source on GitHub ↗
(value: BytesLike)

Source from the content-addressed store, hash-verified

376
377 // Arrayish item; pad on the right to *nearest* WordSize
378 writeBytes(value: BytesLike): number {
379 let bytes = getBytesCopy(value);
380 const paddingOffset = bytes.length % WordSize;
381 if (paddingOffset) {
382 bytes = getBytesCopy(concat([ bytes, Padding.slice(paddingOffset) ]))
383 }
384 return this.#writeData(bytes);
385 }
386
387 // Numeric item; pad on the left *to* WordSize
388 writeValue(value: BigNumberish): number {

Callers 3

encodeMethod · 0.45
encodeMethod · 0.45
encodeMethod · 0.45

Calls 4

#writeDataMethod · 0.95
getBytesCopyFunction · 0.90
concatFunction · 0.90
sliceMethod · 0.45

Tested by

no test coverage detected