UNPKG
@charterlabs/permissionless
Version:
latest (0.0.8-alpha.3)
0.0.8-alpha.3
0.0.8-alpha.2
0.0.8-alpha.1
0.0.7
0.0.6
0.0.5
0.0.4
0.0.2
0.0.1
A utility library for working with ERC-4337
docs.pimlico.io/permissionless
@charterlabs/permissionless
/
utils
/
encodeNonce.ts
9 lines
(6 loc)
•
271 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
import
{ toHex }
from
"viem"
export
function
encodeNonce
(
args
: { key:
bigint
; sequence:
bigint
}
):
bigint
{
const
key =
BigInt
(
toHex
(args.
key
, {
size
:
24
}))
const
sequence =
BigInt
(
toHex
(args.
sequence
, {
size
:
8
}))
return
(key <<
BigInt
(
64
)) + sequence }