投稿時間:2021-11-28 20:19:16 RSSフィード2021-11-28 20:00 分まとめ(22件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
AWS lambdaタグが付けられた新着投稿 - Qiita AWS SAMでアプリケーションをローカルテスト&デプロイ https://qiita.com/Geeryo/items/bb7f0606218d108ee24e AWSSAMでアプリケーションをローカルテストデプロイはじめにこちらの記事で作成した環境をテンプレート化したいと思ったので、AWSSAMを使ってみました。 2021-11-28 19:42:05
js JavaScriptタグが付けられた新着投稿 - Qiita Reactで複数classNameを扱いづらかったので使いやすくしてみた https://qiita.com/programmingcafeteria/items/3770c691c5652e4e2b79 Reactで複数classNameを扱いづらかったので使いやすくしてみたReactのclassNameが使いづらいReactでclassNameが複数あったり、条件によって付けたりつけなかったりするときに複数ltdivclassNamebtnredgtltdivgt条件分岐ltdivclassNameconditionredbluegtltdivgt組み合わせltdivclassNamebtnconditionredbluegtltdivgtうん、見にくいし、をつけ忘れる。 2021-11-28 19:54:38
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) DateFrameで取り出したデータをExcelの帳票に転記したい。 https://teratail.com/questions/371366?rss=all cvcvr 2021-11-28 19:57:01
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) 【Python】【Tkinter】表の各行の横に設定したCheckboxについて、チェックされたレコード番号を取得したい https://teratail.com/questions/371365?rss=all 【Python】【Tkinter】表の各行の横に設定したCheckboxについて、チェックされたレコード番号を取得したい前提・実現したいこと【Python】【Tkinter】表の各行の横に設定したCheckboxについて、チェックされたレコード番号を取得したいここに質問の内容を詳しく書いてください。 2021-11-28 19:54:30
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) 【PHP】DBの値が特定の条件になったとき、モーダルウィンドウを表示 https://teratail.com/questions/371364?rss=all 【PHP】DBの値が特定の条件になったとき、モーダルウィンドウを表示お世話になっております。 2021-11-28 19:23:25
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) 【Three.js】シューティングゲームで弾クラスの配列化と描画が上手くいかない https://teratail.com/questions/371363?rss=all 【Threejs】シューティングゲームで弾クラスの配列化と描画が上手くいかない何に取り組んでいるかThreejsというjavaScriptのフレームワークでシューティングゲームを作っています。 2021-11-28 19:16:25
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) 昼夜を再現するためにDirectionalLightを動かすと影がびくびくするのでびくびくしないようにしたい https://teratail.com/questions/371362?rss=all 昼夜を再現するためにDirectionalLightを動かすと影がびくびくするのでびくびくしないようにしたい昼夜を再現する為にスクリプトを使いDirectionalLightを動かすと下記にあるGIFの様に影がびくびくします。 2021-11-28 19:14:24
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) ポインタのポインタのアクセスのやり方 https://teratail.com/questions/371361?rss=all 2021-11-28 19:13:06
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) IntelliJでMinecraftのModがうまくできません https://teratail.com/questions/371360?rss=all 2021-11-28 19:12:19
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) GASで3日前リマインドメールの自動送信 https://teratail.com/questions/371359?rss=all トリガーでは毎月日に設定→解決済②もしも、未回答案件があったら締切日の日前に未回答の方へメールが届く。 2021-11-28 19:11:57
AWS AWSタグが付けられた新着投稿 - Qiita AWS新サービス「Resilience Hub」を使ってみた https://qiita.com/minorun365/items/0e59cb2ab0e2fd873f40 そのためにはRPO、RTOといった非機能要件が定義されていることが大前提だが…あと、様々なAWSサービスをちゃんと実験できるように、インフラエンジニアなりにも検証用アプリケーションぐらいはちゃんと準備しておこうと思いました。 2021-11-28 19:51:26
AWS AWSタグが付けられた新着投稿 - Qiita AWS SAMでアプリケーションをローカルテスト&デプロイ https://qiita.com/Geeryo/items/bb7f0606218d108ee24e AWSSAMでアプリケーションをローカルテストデプロイはじめにこちらの記事で作成した環境をテンプレート化したいと思ったので、AWSSAMを使ってみました。 2021-11-28 19:42:05
技術ブログ Developers.IO [アップデート] Amazon EventBridgeのリージョン間イベント転送が全リージョンで送受信できるようになりました! https://dev.classmethod.jp/articles/eventbridge-cross-region-expands/ amazoneventbridge 2021-11-28 10:41:00
海外TECH DEV Community Building a web3 frontend with React https://dev.to/rounakbanik/building-a-web3-frontend-with-react-340c Building a web frontend with React IntroductionIn a previous tutorial we covered how to create and deploy an NFT collectible smart contract from scratch We also explored how to verify our contract on etherscan and enable yourself as well as your users to call functions directly from the contract s etherscan page However most serious projects tend to deploy their own websites and allow users to mint directly from the website This is exactly what we will be covering in this tutorial More specifically this tutorial will show you how to Let users connect their Metamask wallet to your websiteAllow users to call a contract function make a payment and mint an NFT from your collection By the end of this tutorial you ll have a fully functioning web frontend built with React You will have also gained the foundational knowledge required to build any general purpose web frontend beyond an NFT minter PrerequisitesThis tutorial assumes you have already developed and deployed your smart contract to the Rinkeby test network If you haven t we strongly suggest you go through this tutorial In order to follow along with this tutorial you will need the following The ABI file for your smart contract which is available in the artifacts folder of your smart contract project The address of your smart contract We also assume that you have experience working with React and Javascript If not we strongly suggest you go through the official tutorial on React s website first Setting up the projectLet s start off by creating a React project using create react app Open your terminal and run the following command npx create react app nft collectible frontendThe installation process will take anywhere between minutes Once its done check that everything is working by running the following cd nft collectible frontendnpm startIf all goes well you should see your browser open a new tab at localhost with the following screen Pretty standard React stuff Let s do a little cleanup now Go to public index html and change the title and meta description of your website This step is optional Next go to the src folder and delete the App test js logo svg and setupTests js files We will not be needing these files for this tutorial Go to the App js file and replace its contents with the following boilerplate import App css function App return lt h gt Hello World lt h gt export default App Remove all the contents of App css as well Do not however delete this file In a later section we will provide you with some basic styling that should be good enough for this demo project If you go back to localhost you should see a screen that says Hello World We now have a basic react project set up and good to go Getting contract ABI and addressFor our React frontend to be able to connect and communicate with our smart contract it needs the contract s ABI and address ABI or Application Binary Interface is a JSON file that is automatically generated during contract compilation The blockchain we deploy to stores our smart contract in the form of bytecode In order to invoke functions on it pass the correct parameters and parse return values using a high level language we need to specify details about the functions and the contract such as name arguments types etc to our frontend This is exactly what the ABI file does In order to learn more about the ABI we suggest you go through this excellent post To find your ABI file go to your hardhat project and navigate to artifacts contracts NFTCollectible sol NFTCollectible json We need to now copy the JSON file to our React project Create a new folder called contracts in the src folder and paste the NFTCollectible json file You should already have the address of your deployed smart contract If you don t just deploy it to Rinkeby again and get the latest address and ABI file Our contract address from the previous tutorial is xaeCcbffcdF We will be using this contract in this tutorial too Let us now import the contract ABI and define the contract address in the App js file Setting up boilerplate HTML CSS and JSOur website is going to be incredibly simple All it will have is a heading and a Connect Wallet button Once the wallet is connected the Connect Wallet button will be replaced by a Mint NFT button We re not going to bother with creating separate component files Instead we will write all our HTML and logic in App js and all our CSS in App cssCopy the contents of the following Github gist into your App js file import useEffect from react import App css import contract from contracts NFTCollectible json const contractAddress xaeCcbffcdF const abi contract abi function App const checkWalletIsConnected gt const connectWalletHandler gt const mintNftHandler gt const connectWalletButton gt return lt button onClick connectWalletHandler className cta button connect wallet button gt Connect Wallet lt button gt const mintNftButton gt return lt button onClick mintNftHandler className cta button mint nft button gt Mint NFT lt button gt useEffect gt checkWalletIsConnected return lt div className main app gt lt h gt Scrappy Squirrels Tutorial lt h gt lt div gt connectWalletButton lt div gt lt div gt export default App Remember to set the correct contract address on line Notice that we have defined a few functions for you which do not do a lot at the moment We will be explaining their purpose and populating them with logic as we proceed with this tutorial We have a small amount of CSS for you to use too Copy the following into your App css file main app text align center margin px cta button padding px border none border radius px min width px color white font size px cursor pointer connect wallet button background rgb mint nft button background orange Your website should now look like this Feel free to customize the look of the website by adding more styles and static elements images header footer social media links etc We ve put together most of the foundational blocks of the project We are now in a good position to tackle one of the first major objectives of this tutorial allowing a user to connect their wallet to our website Connecting Metamask WalletFor a user to call functions from our contract they need to be able to connect their wallet to our website The wallet will enable the user to pay gas and the sale price in order to mint an NFT from our collection In this tutorial we will be working exclusively with the Metamask wallet and its suite of APIs Off the shelf solutions like Moralis and webmodal exist that allow you to add support for multiple wallets with very few lines of code But for this project we will focus on implementing connect wallet functionality from scratch We will cover solutions like Moralis in a later tutorial We assume you already have the Metamask wallet extension installed in your browser If you do Metamask injects an ethereum object into your browser s global window object We will be accessing window ethereum to perform the bulk of our functionality Checking if Metamask Wallet ExistsA user cannot mint NFTs on our website unless they have a Metamask wallet Let s populate the checkWalletIsConnected function within the App component that checks if the Metamask wallet exists Note that we have also defined the useEffect hook that checks Metamask s existence when the App component loads Open the console on your app s localhost page If you have Metamask installed you should see a message that says Wallet exists We re ready to go Connecting Metamask ProgrammaticallyJust because we have the Metamask extension installed doesn t mean that Metamask will automatically connect to every website we visit We need to prompt Metamask to ask the user to do so This is where the Connect Wallet functionality comes in It is the web equivalent of a login button It allows the user to connect and send contract function call requests through the website frontend Metamask makes this process remarkably simple with the window ethereum request method Let s first define a variable in App with the useState hook that will keep track of the user s wallet address Don t forget to import useState from React const currentAccount setCurrentAccount useState null Now let s define the connectWalletHandler function Let s briefly go through what this function does It checks if you have Metamask installed If not the website displays a pop up asking you to install Metamask It requests Metamask for the user s wallet addresses Once the user has consented to connect with the website it takes the first wallet address that is available and sets it as the value of the currentAccount variable If something goes wrong such as the user refusing to connect it fails and prints an error message to the console At the moment if you open the Metamask extension on your website it will tell you that you re not connected It is now time for the moment of truth Click on the Connect Wallet button on your website Metamask will prompt you to connect with the website Once you agree to do so your extension screen will look like this Congratulations We have successfully connected our wallet to our website Once the wallet is connected we should ideally replace the Connect Wallet button with a Mint NFT button In the return value of App let s replace the render of a Connect Wallet button with a conditional render currentAccount mintNftButton connectWalletButton Our website should now look like this Let s refresh our page and check our extension You will see that Metamask tells us that we are still connected to the website but our website still displays a Connect Wallet button If you re familiar with React it should be obvious why this is happening After all we are setting the currentAccount state only within the connectWallet function Ideally what should happen is that the website should check if the wallet is connected every time the App component is loaded i e every time we refresh Let us extend the checkWalletIsConnected function to check for accounts as soon as the website is loaded and set currentAccount if the wallet has already been connected Note that we have marked this function async Let s briefly touch upon what this function does It checks if Metamask is installed and outputs result to the console It attempts to request Metamask for accounts that are connected If Metamask is already connected it obliges by giving the function a list of accounts If not an empty list is returned If the list is not empty the function picks the first account sent over by Metamask and sets it as the current account If you now refresh the page you will see that the website indeed displays the Mint NFT button as it should Mint NFTs from the websiteLet us now implement the core functionality of our website When a user clicks on the Mint NFT button we expect the following to happen Metamask prompts the user to pay the NFT s price gas Once the user accepts Metamask calls the mintNFT function of our contract on behalf of the user It notifies the user about the success failure of the transaction once it is complete To do this we will require the ethers library from our smart contract project In your terminal run the following command npm install ethersLet us import this library in App js import ethers from ethers Finally let s populate the mintNftHandler function Don t forget to mark this function as async As usual let s touch upon what this function does It tries to access the ethereum object injected by Metamask If ethereum exists it sets Metamask as the RPC provider This means that you will be issuing requests to the miners using your Metamask wallet To issue requests the user will need to sign transactions using their private key We access signer for this purpose We then initiate an ethers Contract instance using the deployed contract s address the contract ABI and the signer We can now call functions on our contract through the aforementioned contract object We call the mintNFT function and ask Metamask to send ETH which is the price we set for our NFT We wait for the transaction to be processed and once it s done we output the transaction hash to the console If anything fails the wrong function called wrong parameters passed lt ETH sent user rejected transaction etc an error is printed to the console On your website open your browser s console so that you are able to view the mining status in real time Now click on the Mint NFT button Metamask will prompt you to pay ETH gas The transaction will take approximately seconds to process Once it s done the transaction will be confirmed both by a Metamask popup and the console output You can now view the NFT on Opensea too Navigate to your account on testnets opensea io and you should be able to see your latest NFT UX Improvements amp ConclusionCongratulations You now have a fully functioning web frontend that users can mint NFTs from However as you may have noticed the UX of the website leaves a lot to be desired Here are a few improvements that you should consider doing Ensure the user is connected to the right networkOur website assumes that the user is connected to the Rinkeby Network when interacting with our website This may not always be the case Can you implement functionality that gently alerts the user if s he is not connected to Rinkeby like OpenSea does Also ensure that the user is not able to see the Mint NFT button when connected to the wrong network Show transaction statusCurrently our website prints the transaction status onto the console In a real project you cannot really expect your users to open their console while interacting with the website Can you implement state which tracks the transaction status and gives feedback to the user in real time It should show a loader when the transaction is processing notify the user if the transaction has failed and display the transaction hash Opensea link if the transaction has succeeded Prompt Metamask even if funds are non existentIf you do not have any ETH in your Metamask wallet clicking on Mint NFT will not prompt Metamask at all In fact the user will receive no feedback Can you ensure that Metamask is prompted even when the user has insufficient funds It should ideally be Metamask that informs the user how much ETH is required and how much s he is short by Other Quality of life changesHere are a few other quality of life changes that you can consider Allow users to mint more than NFT at a time Add a few sample artworks from your NFT collection Add a link to your collection on Opensea Add the verified smart contract address so people can double check what s really happening behind the scenes Add links to your Twitter IG and Discord Our NFT sandbox project Rinkeby Squirrels implements a majority of the UX upgrades mentioned here Try and mint one here and see if you can notice the difference between it and the website we built We will be launching future tutorials showing you how to implement a few of these upgrades But we really suggest you try doing this yourself You ll be one step closer to becoming a web frontend master If you have any questions or are stuck reach out to us on our Discord If you don t have questions come say hi to us on our Discord anyway Also if you liked our content we would be super grateful if you tweet about us follow us ScrappyNFTs and Rounak Banik and invite your circle to our Discord Thank you for your support Final code repository About Scrappy SquirrelsScrappy Squirrels is a collection of randomly generated NFTs Scrappy Squirrels are meant for buyers creators and developers who are completely new to the NFT ecosystem The community is built around learning about the NFT revolution exploring its current use cases discovering new applications and finding members to collaborate on exciting projects with Join our community here 2021-11-28 10:46:46
海外TECH DEV Community Request/Response Cycle of Django — Basic https://dev.to/ahmetonurslmz/requestresponse-cycle-of-django-basic-4n7f Request Response Cycle of Django ーBasicDjango is a popular framework that is used by many high level tech companies for back end development Django has lots of handy structure to handle web applications One of them is request response cycle of django that we will cover today Article is here 2021-11-28 10:43:29
海外ニュース Japan Times latest articles Kyoto clinches promotion after 11 seasons in second division https://www.japantimes.co.jp/sports/2021/11/28/soccer/j-league/kyoto-clinches-promotion-11-seasons-second-division/ Kyoto clinches promotion after seasons in second divisionKyoto which joined the J League in rediscovered its winning ways under first year manager Cho Kwi jae who led Shonan Bellmare to promotion three times 2021-11-28 19:31:51
海外ニュース Japan Times latest articles Flawless Terunofuji finishes with career-first perfect record https://www.japantimes.co.jp/sports/2021/11/28/sumo/basho-reports/kyushu-basho-day-15/ Flawless Terunofuji finishes with career first perfect recordAfter winning his maiden meet at yokozuna in September Terunofuji is the first wrestler since time champion Taiho in to win in his first 2021-11-28 19:15:10
ニュース BBC News - Home Covid: Face masks to be compulsory in England from Tuesday, says Javid https://www.bbc.co.uk/news/uk-59449480?at_medium=RSS&at_campaign=KARANGA christmas 2021-11-28 10:28:20
ニュース BBC News - Home Migrant crisis: Priti Patel not included in Calais meeting https://www.bbc.co.uk/news/uk-59448398?at_medium=RSS&at_campaign=KARANGA calais 2021-11-28 10:18:30
ニュース BBC News - Home Evans loses Britain's opener in Davis Cup Finals tie against Czech Republic https://www.bbc.co.uk/sport/tennis/59450633?at_medium=RSS&at_campaign=KARANGA Evans loses Britain x s opener in Davis Cup Finals tie against Czech RepublicGreat Britain s bid to reach the last eight at the Davis Cup Finals suffers a blow as Dan Evans loses the opening match against the Czech Republic 2021-11-28 10:50:57
北海道 北海道新聞 漁協、協定改定で空港共用議論へ 佐賀、オスプレイ配備計画巡り https://www.hokkaido-np.co.jp/article/616567/ 佐賀空港 2021-11-28 19:19:00
北海道 北海道新聞 阿炎が敢闘賞、宇良は技能賞 隆の勝は11勝で敢闘賞 https://www.hokkaido-np.co.jp/article/616566/ 大相撲九州場所 2021-11-28 19:19:00

コメント

このブログの人気の投稿

投稿時間:2021-06-17 05:05:34 RSSフィード2021-06-17 05:00 分まとめ(1274件)

投稿時間:2021-06-20 02:06:12 RSSフィード2021-06-20 02:00 分まとめ(3871件)

投稿時間:2020-12-01 09:41:49 RSSフィード2020-12-01 09:00 分まとめ(69件)