Skip to content

Commit 4bbc881

Browse files
Mrtenzmetamaskbot
andauthored
Add image fetching utility functions (#1995)
This adds two new functions which can be used for fetching images (PNG, JPG) in a Snap: - `getImageData`: Returns the raw image data string, which can be used as a `href` in an SVG image. - `getImageComponent`: Returns an image component which can be used in Snaps UI. Closes MetaMask/MetaMask-planning#1573. --------- Co-authored-by: MetaMask Bot <metamaskbot@users.noreply.github.com>
1 parent 51ba433 commit 4bbc881

23 files changed

Lines changed: 372 additions & 12 deletions

File tree

packages/examples/packages/bip32/snap.manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"url": "https://github.com/MetaMask/snaps.git"
88
},
99
"source": {
10-
"shasum": "8uciDR11gmEm8QDs/sHYPeICmkpHOE4qVe+7zF0O7Ew=",
10+
"shasum": "caeLbHfeSy43AMJYg8DJuzwgNfQBsDYhSs7Fa1+RJpg=",
1111
"location": {
1212
"npm": {
1313
"filePath": "dist/bundle.js",

packages/examples/packages/bip44/snap.manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"url": "https://github.com/MetaMask/snaps.git"
88
},
99
"source": {
10-
"shasum": "7WXzhl1UIxj91n9Ptv/Rf+nbsYUg3XSOP14sSwEcI2k=",
10+
"shasum": "l299RzPiq3zALuL5iOeVme+7lfA0cnEAz+w4DMJM0Rw=",
1111
"location": {
1212
"npm": {
1313
"filePath": "dist/bundle.js",

packages/examples/packages/cronjobs/snap.manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"url": "https://github.com/MetaMask/snaps.git"
88
},
99
"source": {
10-
"shasum": "CxqAZ3b6NadkqDJJDZnKKhXS8ecdcV+qIf/dOmMHzbk=",
10+
"shasum": "PX7YVTXzXsTT2qnvBj4DAn87yuFJUlW6fHu9A6lLh7I=",
1111
"location": {
1212
"npm": {
1313
"filePath": "dist/bundle.js",

packages/examples/packages/dialogs/snap.manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"url": "https://github.com/MetaMask/snaps.git"
88
},
99
"source": {
10-
"shasum": "BSNPuKt7cC0lEJaE8M6Y0/7tepS8HiC/+WpjZaOYwYM=",
10+
"shasum": "vUCiymjk/mJ7B43hy2yikoGTltGsQRLbkIjp1FT/eLM=",
1111
"location": {
1212
"npm": {
1313
"filePath": "dist/bundle.js",

packages/examples/packages/ethers-js/snap.manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"url": "https://github.com/MetaMask/snaps.git"
88
},
99
"source": {
10-
"shasum": "FL7kREmDDwiAIHskdA1lbCYQ4NHv8p4UHR/1Tm2mKKA=",
10+
"shasum": "STj20RDfb7MnKDa5ONLfBdRv4VawZ3uf0Da7jp5scC4=",
1111
"location": {
1212
"npm": {
1313
"filePath": "dist/bundle.js",

packages/examples/packages/get-entropy/snap.manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"url": "https://github.com/MetaMask/snaps.git"
88
},
99
"source": {
10-
"shasum": "FzwUtEms+bZSRoUP/48CxTVoSkoQCLG+86oWSUZfueA=",
10+
"shasum": "h5MEtNyMAG2rQhGD90im8kCg/ESRCkoVb9/D7AR2tA4=",
1111
"location": {
1212
"npm": {
1313
"filePath": "dist/bundle.js",

packages/examples/packages/home-page/snap.manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"url": "https://github.com/MetaMask/snaps.git"
88
},
99
"source": {
10-
"shasum": "utXHOukgm1RlUl/sYsI2aNAgeVgEKL+310wUjEAMT9E=",
10+
"shasum": "Jn+BqJIA+xxLU9bmG8ZSBPSSNiF83izvgh6qqP+1ZxY=",
1111
"location": {
1212
"npm": {
1313
"filePath": "dist/bundle.js",

packages/examples/packages/invoke-snap/packages/core-signer/snap.manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"url": "https://github.com/MetaMask/snaps.git"
88
},
99
"source": {
10-
"shasum": "dbIz1yLy7sqedSP6sb8cD5DJgDloM08zJERPa/e8N78=",
10+
"shasum": "BM0j/V7cf9ii7afLVn7u8GMjIthkwyJohQ6Uiu8YjKw=",
1111
"location": {
1212
"npm": {
1313
"filePath": "dist/bundle.js",

packages/examples/packages/lifecycle-hooks/snap.manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"url": "https://github.com/MetaMask/snaps.git"
88
},
99
"source": {
10-
"shasum": "Ve8xul91MklBaGJpiaLvCB/qIHIXZEj251XP+pIOOUQ=",
10+
"shasum": "NHngSVQOR00sgw+NWSDuBch8IeI+Taz8Im/DeKkqGlo=",
1111
"location": {
1212
"npm": {
1313
"filePath": "dist/bundle.js",

packages/examples/packages/manage-state/snap.manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"url": "https://github.com/MetaMask/snaps.git"
88
},
99
"source": {
10-
"shasum": "ClCqeb7sknLcct1+EMSjDpNqockG+NVmKnBmfXRXPpM=",
10+
"shasum": "Y9dJ+4nEhSNmGJ0WtW9ebY88bDtn0QSCM5tRNzKl65s=",
1111
"location": {
1212
"npm": {
1313
"filePath": "dist/bundle.js",

0 commit comments

Comments
 (0)