UNPKG
@iam4x/bsc-scan
Version:
latest (3.3.4)
3.3.4
3.3.3
3.3.2
3.3.1
An efficient BNB and token balance scanner
iam4x/eth-scan
@iam4x/bsc-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)}
`
;