UNPKG
@uniswap/universal-router
Version:
beta (1.4.1-beta.1)
latest (2.1.0)
2.1.0
2.0.0
2.0.0-beta.2
2.0.0-beta.1
1.6.1-beta.1
1.6.0
1.5.1
1.5.0
1.4.3
1.4.2
1.4.1
1.4.1-beta.1
1.4.1-beta.0
1.4.0
1.4.0-beta.0
1.3.1
1.3.0
1.2.2
1.2.1
1.1.1
1.1.0
1.0.1
1.0.0
Smart contracts for Universal Router
Uniswap/universal-router
@uniswap/universal-router
/
lib
/
v3-periphery
/
test
/
shared
/
extractJSONFromURI.ts
6 lines
(5 loc)
•
286 B
text/typescript
View Raw
1
2
3
4
5
6
export
function
extractJSONFromURI
(
uri:
string
):
{ name:
string
; description:
string
; image:
string
} {
const
encodedJSON
= uri.
substr
(
'data:application/json;base64,'
.length)
const
decodedJSON
= Buffer.
from
(encodedJSON,
'base64'
).
toString
(
'utf8'
)
return
JSON.
parse
(decodedJSON) }