UNPKG
@phiresky/eth-scan
Version:
latest (3.5.4)
3.5.4
An efficient Ether and token balance scanner
MyCryptoHQ/eth-scan
@phiresky/eth-scan
/
src
/
utils
/
abi.ts
11 lines
(9 loc)
•
267 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
10
11
import
{ toHex }
from
'@findeth/abi'
;
/** * Add 0x-prefix and ABI identifier to an encoded buffer. * *
@param
{
string
}
id
*
@param
{
Uint8Array
}
data
*
@return
{
string
} */
export
const
withId = (
id
:
string
,
data
:
Uint8Array
):
string
=>
`0x
${id}
${toHex(data)}
`
;