File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -495,16 +495,19 @@ export default defineComponent({
495495 // For now only plain USDC/Polygon/ETH addresses are supported.
496496 // TODO support Polygon-USDC request links and even consider removing scanning of plain addresses
497497 // due to the risk of USDC being sent on the wrong chain.
498- uri = uri .replace (` ${window .location .origin }/ ` , ' ' )
499- .replace (' polygon:' , ' ' );
498+ const url = new URL (uri );
500499 const { ethers } = await getPolygonClient ();
501- if (ethers .utils .isAddress (uri )) {
500+ if (ethers .utils .isAddress (url . pathname )) {
502501 if (event ) {
503502 // Prevent paste event being applied to the recipient label field, that now became focussed.
504503 event .preventDefault ();
505504 }
506505
507- onAddressEntered (uri );
506+ await onAddressEntered (url .pathname );
507+
508+ if (url .searchParams .has (' amount' )) {
509+ amount .value = parseFloat (url .searchParams .get (' amount' )! ) * 1e6 ;
510+ }
508511 }
509512 }
510513
You can’t perform that action at this time.
0 commit comments