UNPKG
@mycrypto/eth-scan
Version:
latest (3.5.3)
3.5.3
3.5.2
3.5.1
3.5.0
3.4.4
3.4.3
3.4.2
3.4.1
3.4.0
3.3.1
3.3.0
3.2.1
3.2.0
3.1.2
3.1.1
3.1.0
3.0.0
2.1.0
2.0.1
2.0.0
1.1.0
1.0.1
1.0.0
An efficient Ether and token balance scanner
MyCryptoHQ/eth-scan
@mycrypto/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)}
`
;