{"id":"U8ngm2hR4a4","title":"NEAR Intents 102: Build Your First One-Click API App for Cross-Chain Swaps","description":"Josh from NEAR Dev walks through NEAR Intents 102, a hands-on workshop showing how to create and broadcast user intents using the One-Click API and TypeScript SDK. \n\nLearn how to build your own distribution channel, perform cross-chain swaps, and understand how intents work under the hood.\n\nWhat You’ll Learn:\n • ⚙️ Quick review of NEAR Intents flow and architecture\n • 🧠 How to use One-Click API endpoints (/tokens /quote /submit /status)\n • 💻 Setting up environment variables, JWTs, and a NEAR mainnet account\n • 🔄 Executing swaps across NEAR, Arbitrum, and Optimism with no bridge setup\n • 💬 Using TypeScript examples from the NEAR Intents repo\n\nResources Mentioned:\n • Docs: https://docs.near-intents.org/near-in...\n • Examples Repo: https://github.com/near-examples\n • Telegram Support: https://t.me/near_intents","channel_name":"NEAR DevHub","published_at":"2025-10-16T00:00:00.000Z","thumbnail_url":"https://img.youtube.com/vi/U8ngm2hR4a4/hqdefault.jpg","transcript_text":"Hey there, welcome to Near Intense 102, a quick start workshop using oneclick API. I'm Joshua NearDev and let's get started. If you're new to Near Intense, make sure you check out Near Intense 101. Uh we go over all the intense core concepts and components, how they all work together. Uh you'll definitely get a better understanding moving forward. As a brief refresher, here's a highle diagram of the intent flow where a user or agent creates an intent using some type of application. uh we categorize these as distribution channels. From there, the intent is then broadcasted to our market makers that compete to fulfill these requests and upon approval settles a transaction through a series of smart contracts. Of the intense core components, this workshop will focus on how to create a distribution channel or an application used to create, broadcast, and deliver users intents. For this, we're going to use one-click API that simplifies the complexities of intents with easy to use rest points. Uh we got a couple of SDKs to choose from, and for this one, we'll be using the TypeScript SDK. As you can see, there are four endpoints for one-click API to choose from. Uh the main one you'll be using is the quote route. Uh this is for requesting a token swap quote. Uh there's also an optional route of submit which allows you to let the one-click service know that a deposit was completed and it helps speed up the process. We also have two get routes, one of which allows you get all the current supported tokens across the various networks and the other status to check the status of a swap. The flow is super simple. You just create an intent, send it to one click via the quote endpoint, and then you wait a response. That response will be a JSON object with all the quote details in it and a deposit address. If the quote looks good to you, you simply deposit the agreed upon amount to the provided address and then the intent will be executed automatically. It's super simple. Without further ado, let's dive into the code and see how this actually works. All right, so for this workshop, we're going to be using the near intense examples repo. Uh that is under the near examples GitHub organization. You can find that by going to docs.nearintense nearintent.org and from here clicking on distribution channels and oneclick API. Uh here's all the documentation for oneclick and the quick start tutorial is right at the top. So go ahead and click on that link, get to this um repo, go ahead and clone the project and um yeah, you'll just um be required to have mpm or pmpp yarn works as well. um Node.js and some familiarity with TypeScript. Um also a near account for this um workshop. You will need a near account. You don't need a near account to actually perform transactions using near intense. I'll do a demonstration of what that looks like um without a near account, but for the sakes of um this demonstration, you're going to need one with a little bit of near on it. Um just 05 um near will be sufficient. Um just going to be doing some swaps and you'll see how cheap they are. Um but uh yeah, go ahead and get a mainet account. Unfortunately, there is no testn net currently for near intense. So you will need a mainet account. Um also need to grab a JSON web token. Um JSON web token token. I um but yeah, you'll need a JWT. You can request one here, although it's not required. Um not using one, you're going to pay a 0.1% fee on all swaps. Um, so it's a small amount, but um, so yeah, if you just want to do some testing on it and you don't really care, uh, it's fine. You can just comment some things out. I'll show you in the code how that works, but um, it's free to get. Just go ahead and request one um, for your project. So yeah, after that, we're going to go ahead and clone and install our project. Um, install the dependencies. Um, and then we'll set up our environment. I'll go ahead and go to my pre uh cloned and dependency ran uh example. Uh again, you'll have amp example here that you will then, you know, just remove that example and create your own file. Um put your near account that you created. Uh put your private key in here and then also your one-click javascript I'm sorry JSON web token. Okay, so once you have your environment variables configured, let's go ahead and start with step one, and that is get tokens. Get tokens will fetch all of the available tokens across all supported networks. It returns an array of token objects that give you the blockchain network, the symbol of the token, and then also the asset ID, and the contract address. Uh the asset ID is going to be the one you're going to want to pay the most attention to. Uh this is the value that you're going to be using when calling the get quote endpoint, uh which we'll be going over next. it represents the um address of the token on the near network. The contract address is going to be the address of the token on the destination chain. So for in this for this example um this is the address for USDC that is deployed on arbitum. Uh in order to hit this route, we're going to go ahead and import our one-click service from the oneclick TypeScript SDK. Then we will call a method of get tokens and this will return all of those token values. Um, I have a little helper file here that you can explore in utils.ts that basically just groups these tokens by blockchain to make it a little bit um, easier for us to navigate. So, let's go ahead and open up our terminal and we will go ahead and run pmppm get tokens which is a script in our package.json. And as you can see, this is all of the current supported tokens across all the various networks. Um so on Salana here are all the current supported tokens on polygon uh near and so on. So um for the next step we are going to choose um arbitum uh we're just going to get the native asset ID uh which is this guy here and then we're going to be using that in our next route of get quote. So heading on over to get quote we have step two this process that we will use to fetch our quote from the network of market makers. Uh at the top we have example swap configuration. Uh but before we get into those values let's take a look over how get quote actually works. We start by uh initializing the API client with a base URL and also the JSON web token. Uh if you don't have one, you can go ahead and comment down this line, but um you will pay a 0.1 fee on all swaps. Um go ahead and just yeah, click on that form, get the token. It's free to for you to get. The first parameter is whether or not this is going to be a dry run. Uh if you're going to be using this for testing purposes, just to check to make sure you have all your values correct, um go ahead and leave this as dry. Um when it does return the result, it will not contain a deposit address or when it's inactive or the estimate or deadline. The next value is going to be the swap type. Uh either it's going to be an exact input or the exact output. So, uh if it's set to input, then the input amount is fixed and the output amount will vary. Um or if you have it set to exact output, the output amount, the token out will be fixed. Uh and then the input will vary and it'll refund um any remaining balance over to you. You have your slippage tolerance and then the origin assets. So this is going to be the token you are going to be swapping for. Uh again this is listed as the asset ID in the step before of getting tokens. And then you have the deposit type which is either going to be the origin chain or intense. This is basically the difference between whether or not you want this swap to complete all the way to the destination chain or if you just want to swap in and out of the intense contract. To explain what that actually means, uh let's take a look at what's going on during the intense swap. So, as you know, we start with our intent and we send that over to our market makers to get a quote. When we agree on the terms, we'll send that over to the intent smart contract uh where it gets recorded. Then to fully complete the transaction, there needs to be a settlement on the destination chain by performing a transaction on that destination contract if the swap is non-neative. And for crosschain swaps, it's important to remember that the intense contract is on the near blockchain separate from the destination blockchain. To resolve this, we use the omni bridge to transfer those assets over. So with this full flow, we're paying for gas on the near network. We're paying a small transaction fee for the omni bridge to bridge over the assets. And then we're also paying gas on the destination network. And depending on that network, this can get quite spendy, especially when dealing with say Bitcoin or Ethereum. So if you wanted to perform a series of swaps but wanted to avoid paying bridging and gas fees for the destination chain and take advantage of the low transaction fees and gas prices on near, you can just avoid all the bridging and settling on the destination chain altogether and just interact with the near intense contract. And whenever you're ready, you can settle the final balance on the destination chain. So when you choose intense as the deposit type, you are depositing funds into the intense contract. And then that contract keeps track of your respective token balances until you are ready to withdraw them. All right. Now that you know the difference between intents versus origin chain, a lot of these parameters will now make a lot more sense and be more straightforward. So the next parameter is going to be the destination asset. This is the this is the token that you'll be swapping for. Um or your output token again using that asset ID that we went over earlier. You have your amount which is the amount that you're going to swap for. It's important to note that this is represented in the token smallest unit and will be based on either the input or output token amount. We have our refund to address. This is the address that will receive all funds in case the swap fails. And the type of refund address. So this is going to be the origin chain or intense. So, if you want to refund all of the funds to the address that's on the intense contract, you can do that. Or on the destination chain or the origin chain, you can do that. You have the recipient address and then the recipient type. So, is this address that's receiving the funds, is it on the destination chain or is it an address within the near intent smart contract? You have a deadline which is set to execute 3 minutes from now. This can be changed. You have a referral which is a referral identifier for fee sharing or tracking. And then the maximum time to wait for the quote response. And then once you have that all configured, we just call one method from the one-click service imported from our TypeScript SDK earlier. And that method is get quote and we pass it the quote request. So let's go ahead and go back to our configured swap. Uh again this is our example configuration. We have it set to true for testing. We have the sender address that is configured in our env account uh as a near account. We have a recipient address. This is going to be for the destination chain that I am swapping for. I am going to be um using arbitum in my example. So this is my arbitum address. We have the origin asset which is represented as native near. Uh one click automatically wraps our near for us. So we don't need to worry about that. But the asset ID is wrap. And then the destination address. So this is the address we found on our get quote endpoint that we did in step one. This is native arbitrum. And the amount. So this is the total amount that I'm going to swap for. I'm actually going to change this value to 01 uh just for my testing purposes. Let's test it. So we'll go ahead and open back up our terminal. Now run pmpm get quote. All right. And we have our quote. So as you can see these are all the parameters that we sent to it. This is our quote request that we sent out. And here's the response that we got. Um this is the amount that we're swapping for in again in the smallest unit. It's formatted as 01 near which uh is about 3 cents USD. And this is the amount that we will receive. So, this looks all good to me. Let's go ahead and actually do an actual swap. So, we'll go ahead and change this to false. Open back up our terminal. Run it again. And now you can see we have a deposit address, a deadline, and time when inactive. Now to send this, we don't necessarily need to run this script here. We could test it out by just grabbing this deposit address and then opening up a wallet. So I'll go ahead and go to my wallet. I'll go to send. I will send 01 near to this account address and hit continue. Says account doesn't exist yet. It'll be created on deposit. That is exactly what we want. All right. Token sent successfully. So now we can go to our intents explorer and if we want we can monitor this intent by pasting in that deposit address. Ah and you can see it is processing. So we can see that was created. The deposit is complete and all right. Yeah looks like we did a successful swap. And if we keep scrolling down, we can see our destination chain transaction. We look at arbit scan. See this was successful. And we can take a look at our near transactions. See all those individual transactions on the near side. All right. So, we've completed a successful swap. And now you can see where earlier I was saying you don't necessarily need a near account uh to perform any of this because the sender address and the recipient address could be non-native near addresses. Um so yeah, if I wanted to take my arbitum address and put that where my sender address was and now say I have a different address on a different network, I can put that value there. I can get my quote and then I just send um a deposit on that native network. To give you a quick demo on how this would work, let's modify our swap configuration values and we'll get a new quote that doesn't involve any near native asset swapping. Um so now that we've swapped some near for arbitum on this account, we can go ahead and use that account as the sender address and we'll swap arbitrum for another token on a separate network. um we can make things easy for us and just choose another L2 network so we can reuse this address and the origin asset will be updated to our arbitrum token and then for the destination asset let's go ahead and choose a token on another L2 we will select um let's go with optimism So we are going to swap for native op. We'll go ahead and copy this value and paste it as our destination asset and the amount. So again this has to be the token amount that's in the smallest unit. Here is a helper file that we use to convert our near to yaktonir which is 10^ the - 24th. I believe arbitrum uses 10 to the 18th and uh we can double check that by going to an explorer go to arbitum and they have a unit converter here on arbbercan and yeah it's 10 to the 18th for one arb. Let's go back here. Let's paste in this amount. And this is as a string. And all right. So, we are going to swap from our arbitrum account to an account that we're going to create on the optimism network. We're going to have the origin asset as arbitum and then the destination asset is going to be optimism on the optimism network. Um, so yeah, we can check in our MetaMask and see. Yep, we have um some tokens on arbitrum and on optimism we have a zero balance here. So um with a successful swap, this value should um give us one optimism token. So let's go back here and let's get our quote. So we'll do pmppm get quote. All right. And yeah, we have the correct amount formatted. One token in and we will get just about half of an optimism token and the amount in is 40 cents, amount out is 38 cents. So yeah, spending about penny and a half for the swap. Cool. So this looks good. Let's grab this deposit address. And this is a deposit address that is on the arbitum network. So, we'll go back here. We'll go to Arbitum. We'll send here paste in our deposit address. And we'll select arbitum. And we are going to send one ARB to this deposit address. We'll hit continue. And looks like we'll pay 2 cents ETH. Go ahead and confirm. All right, transaction looks like it's complete. So again, we can go back to our intense explorer. We can paste in the deposit address and we can see that this is now processing. So it's created, deposits complete, and now it is processing. and complete. Awesome. So we can see now the transaction is complete and we can view the transactions on the destination chain of optimism and also see the transactions that took place on the near network. Uh but again we didn't actually need a near account for any of this to work. These are all the transactions that took place under the hood uh using oneclick API. And we can go to our MetaMask account and check our balances. And yeah, here we go. Now we have Optimism in our previously unfunded account. And again, this was used just from one arbitum account to one optimism account, both using Ethereum L2s with no near account actually required to perform the transaction. All right, so that's get quote. Um, the rest of these files are kind of just going over what you already know. Um, this is a send deposit script. Um, this uses near APIJS um to send tokens using your private key that is that was configured in your end file. Um, this just yeah uh basic functionality of how near works for getting an account and transferring tokens over. You can find more about this in our documentation online at docs.near.org. And we have those two optional endpoints for oneclick API. Uh one of them is submitting the transaction hash to oneclick. Um this just speeds up the process um by early notification to oneclick API that a swap has taken place. And again this um everything you know from the TypeScript SDK uses this one-click service um and it will call submit deposit transaction and then you just uh deposit the transaction hash along with the deposit address that you sent that to. And then we also have that optional check status endpoint. Um, and this is where we can check the status of the ongoing swap. Again, using the one-click service import, uh, and calling get execution status based on the deposit address. So, finally, we have this file here that uses all of these steps above uh, steps two through five. And, um, please note that this file is configured differently uh, than the other file. So if you um configured get quote earlier um these are the values that you're going to use for a full swap. Um so in here I have my near sender account. I have my private key. Um again that's set up in my M file. Um I have my recipient address which is my arbitum address and now my optimism address as well. Um and then this is my origin asset. that I have native near my destination asset which is going to be native ARB and then the amount that I want to swap for. And you can play with any one of these values. Um and then what it does is it basically just imports um all of those functions from the earlier steps and calls them one by one. So first we get a quote. Then after the quote, um, we'll go ahead and display the swap cost to kind of give a the user a breakdown. Uh, then in step two, we'll send the deposit over. After a deposit has been sent, we'll do that optional submitting the transaction hash to one click. Then we're going to pull the status until there's a successful result. Um, and then after the result, we'll give the user um a link to the uh transaction that they can view it. So yeah, let's go ahead and try this out. Let's go go PMPM full swap. And it starts with step one by getting our quote. All right, we got our quote for 01 near uh 4.065 arbitum. Uh we have our deposit address and a little swap cost breakdown table here that explains that yeah, we're basically paying 04 cents for the swap. Um, we can go and check our deposit, make sure that it was successful on near blocks, which it says it was. And yeah, now we are monitoring our swap status as it's showing us pending and processing. And now a success. And let's go ahead and view our final transaction on the Near Intense Explorer. All right, perfect. Looks like uh yeah we created deposit process and withdrew our funds from the account into our arbitum account and successfully swapped 01 near for 065 arbitum. All right, thanks so much for watching. I hope this workshop was helpful for you. Um here you'll find some near intense resources that are super helpful. You have the examples repo that we were working with at the top. Uh official documentation for nearintense at docs.nearintense.org. And if anytime you need live support, uh the team's always willing to help on our Telegram support chat near intense.","transcript_synced_at":"2026-11-03T03:50:06.039Z","segments":[{"start_seconds":0,"text":"Hey there, welcome to Near Intense 102, a quick start workshop using oneclick API. I'm Joshua NearDev and let's get","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=0s"},{"start_seconds":7,"text":"started. If you're new to Near Intense, make sure you check out Near Intense 101. Uh we go over all the intense core","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=7s"},{"start_seconds":14,"text":"concepts and components, how they all work together. Uh you'll definitely get a better understanding moving forward.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=14s"},{"start_seconds":21,"text":"As a brief refresher, here's a highle diagram of the intent flow where a user or agent creates an intent using some type of application. uh we categorize","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=21s"},{"start_seconds":30,"text":"these as distribution channels. From there, the intent is then broadcasted to our market makers that compete to fulfill these requests and upon approval","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=30s"},{"start_seconds":38,"text":"settles a transaction through a series of smart contracts.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=38s"},{"start_seconds":42,"text":"Of the intense core components, this workshop will focus on how to create a distribution channel or an application used to create, broadcast, and deliver users intents.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=42s"},{"start_seconds":54,"text":"For this, we're going to use one-click API that simplifies the complexities of intents with easy to use rest points. Uh we got a couple of SDKs to choose from,","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=54s"},{"start_seconds":62,"text":"and for this one, we'll be using the TypeScript SDK. As you can see, there are four endpoints for one-click API to","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=62s"},{"start_seconds":69,"text":"choose from. Uh the main one you'll be using is the quote route. Uh this is for requesting a token swap quote. Uh","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=69s"},{"start_seconds":77,"text":"there's also an optional route of submit which allows you to let the one-click service know that a deposit was completed and it helps speed up the","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=77s"},{"start_seconds":85,"text":"process. We also have two get routes, one of which allows you get all the current supported tokens across the various networks and the other status to check the status of a swap.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=85s"},{"start_seconds":97,"text":"The flow is super simple. You just create an intent, send it to one click via the quote endpoint, and then you wait a response. That response will be a","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=97s"},{"start_seconds":105,"text":"JSON object with all the quote details in it and a deposit address. If the quote looks good to you, you simply deposit the agreed upon amount to the","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=105s"},{"start_seconds":113,"text":"provided address and then the intent will be executed automatically. It's super simple. Without further ado, let's dive into the code and see how this","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=113s"},{"start_seconds":121,"text":"actually works. All right, so for this workshop, we're going to be using the near intense examples repo. Uh that is under the near examples GitHub","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=121s"},{"start_seconds":128,"text":"organization. You can find that by going to docs.nearintense nearintent.org","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=128s"},{"start_seconds":135,"text":"and from here clicking on distribution channels and oneclick API. Uh here's all the documentation for oneclick and the","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=135s"},{"start_seconds":142,"text":"quick start tutorial is right at the top. So go ahead and click on that link, get to this um repo, go ahead and clone","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=142s"},{"start_seconds":151,"text":"the project and um yeah, you'll just um be required to have mpm or pmpp yarn works as well. um Node.js and some","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=151s"},{"start_seconds":160,"text":"familiarity with TypeScript. Um also a near account for this um workshop. You will need a near account. You don't need","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=160s"},{"start_seconds":167,"text":"a near account to actually perform transactions using near intense. I'll do a demonstration of what that looks like um without a near account, but for the","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=167s"},{"start_seconds":175,"text":"sakes of um this demonstration, you're going to need one with a little bit of near on it. Um just 05 um near will be","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=175s"},{"start_seconds":183,"text":"sufficient. Um just going to be doing some swaps and you'll see how cheap they are. Um but uh yeah, go ahead and get a mainet account. Unfortunately, there is no testn net currently for near intense.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=183s"},{"start_seconds":195,"text":"So you will need a mainet account. Um also need to grab a JSON web token. Um","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=195s"},{"start_seconds":202,"text":"JSON web token token. I um but yeah, you'll need a JWT. You can request one here, although it's not","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=202s"},{"start_seconds":210,"text":"required. Um not using one, you're going to pay a 0.1% fee on all swaps. Um, so it's a small amount, but um, so yeah, if","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=210s"},{"start_seconds":219,"text":"you just want to do some testing on it and you don't really care, uh, it's fine. You can just comment some things out. I'll show you in the code how that works, but um, it's free to get. Just go","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=219s"},{"start_seconds":227,"text":"ahead and request one um, for your project. So yeah, after that, we're going to go ahead and clone and install our project. Um, install the","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=227s"},{"start_seconds":236,"text":"dependencies. Um, and then we'll set up our environment. I'll go ahead and go to my pre uh cloned and dependency ran uh","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=236s"},{"start_seconds":245,"text":"example. Uh again, you'll have amp example here that you will then, you know, just remove that example and create your own file. Um put your near","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=245s"},{"start_seconds":254,"text":"account that you created. Uh put your private key in here and then also your one-click javascript I'm sorry JSON web","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=254s"},{"start_seconds":261,"text":"token. Okay, so once you have your environment variables configured, let's go ahead and start with step one, and that is get tokens. Get tokens will","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=261s"},{"start_seconds":270,"text":"fetch all of the available tokens across all supported networks. It returns an array of token objects that give you the blockchain network, the symbol of the","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=270s"},{"start_seconds":278,"text":"token, and then also the asset ID, and the contract address. Uh the asset ID is going to be the one you're going to want to pay the most attention to. Uh this is","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=278s"},{"start_seconds":286,"text":"the value that you're going to be using when calling the get quote endpoint, uh which we'll be going over next. it represents the um address of the token","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=286s"},{"start_seconds":295,"text":"on the near network. The contract address is going to be the address of the token on the destination chain. So for in this for this example um this is","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=295s"},{"start_seconds":303,"text":"the address for USDC that is deployed on arbitum. Uh in order to hit this route, we're going to go ahead and import our","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=303s"},{"start_seconds":310,"text":"one-click service from the oneclick TypeScript SDK. Then we will call a method of get tokens and this will","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=310s"},{"start_seconds":317,"text":"return all of those token values. Um, I have a little helper file here that you can explore in utils.ts that basically just groups these tokens by blockchain","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=317s"},{"start_seconds":325,"text":"to make it a little bit um, easier for us to navigate. So, let's go ahead and open up our terminal and we will go","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=325s"},{"start_seconds":333,"text":"ahead and run pmppm get tokens which is a script in our package.json.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=333s"},{"start_seconds":340,"text":"And as you can see, this is all of the current supported tokens across all the various networks. Um so on Salana here","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=340s"},{"start_seconds":348,"text":"are all the current supported tokens on polygon uh near and so on. So um for the","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=348s"},{"start_seconds":356,"text":"next step we are going to choose um arbitum uh we're just going to get the native asset ID uh which is this guy","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=356s"},{"start_seconds":365,"text":"here and then we're going to be using that in our next route of get quote. So heading on over to get quote we have","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=365s"},{"start_seconds":374,"text":"step two this process that we will use to fetch our quote from the network of market makers. Uh at the top we have example swap configuration. Uh but","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=374s"},{"start_seconds":382,"text":"before we get into those values let's take a look over how get quote actually works. We start by uh initializing the","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=382s"},{"start_seconds":389,"text":"API client with a base URL and also the JSON web token. Uh if you don't have one, you can go ahead and comment down","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=389s"},{"start_seconds":395,"text":"this line, but um you will pay a 0.1 fee on all swaps. Um go ahead and just yeah, click on that form, get the token. It's","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=395s"},{"start_seconds":403,"text":"free to for you to get. The first parameter is whether or not this is going to be a dry run. Uh if you're going to be using this for testing purposes, just to check to make sure you","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=403s"},{"start_seconds":411,"text":"have all your values correct, um go ahead and leave this as dry. Um when it does return the result, it will not contain a deposit address or when it's inactive or the estimate or deadline.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=411s"},{"start_seconds":422,"text":"The next value is going to be the swap type. Uh either it's going to be an exact input or the exact output. So, uh","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=422s"},{"start_seconds":430,"text":"if it's set to input, then the input amount is fixed and the output amount will vary. Um or if you have it set to","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=430s"},{"start_seconds":437,"text":"exact output, the output amount, the token out will be fixed. Uh and then the input will vary and it'll refund um any","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=437s"},{"start_seconds":446,"text":"remaining balance over to you. You have your slippage tolerance and then the origin assets. So this is going to be the token you are going to be swapping","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=446s"},{"start_seconds":454,"text":"for. Uh again this is listed as the asset ID in the step before of getting tokens. And then you have the deposit type which is either going to be the","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=454s"},{"start_seconds":462,"text":"origin chain or intense. This is basically the difference between whether or not you want this swap to complete all the way to the destination chain or","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=462s"},{"start_seconds":469,"text":"if you just want to swap in and out of the intense contract. To explain what that actually means, uh let's take a look at what's going on during the","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=469s"},{"start_seconds":476,"text":"intense swap. So, as you know, we start with our intent and we send that over to our market makers to get a quote. When","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=476s"},{"start_seconds":484,"text":"we agree on the terms, we'll send that over to the intent smart contract uh where it gets recorded. Then to fully","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=484s"},{"start_seconds":491,"text":"complete the transaction, there needs to be a settlement on the destination chain by performing a transaction on that destination contract if the swap is non-neative.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=491s"},{"start_seconds":504,"text":"And for crosschain swaps, it's important to remember that the intense contract is on the near blockchain separate from the destination blockchain.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=504s"},{"start_seconds":514,"text":"To resolve this, we use the omni bridge to transfer those assets over.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=514s"},{"start_seconds":519,"text":"So with this full flow, we're paying for gas on the near network. We're paying a small transaction fee for the omni","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=519s"},{"start_seconds":526,"text":"bridge to bridge over the assets. And then we're also paying gas on the destination network. And depending on that network, this can get quite spendy,","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=526s"},{"start_seconds":535,"text":"especially when dealing with say Bitcoin or Ethereum.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=535s"},{"start_seconds":539,"text":"So if you wanted to perform a series of swaps but wanted to avoid paying bridging and gas fees for the destination chain and take advantage of","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=539s"},{"start_seconds":547,"text":"the low transaction fees and gas prices on near, you can just avoid all the bridging and settling on the destination chain altogether and just interact with","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=547s"},{"start_seconds":555,"text":"the near intense contract. And whenever you're ready, you can settle the final balance on the destination chain. So when you choose intense as the deposit","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=555s"},{"start_seconds":563,"text":"type, you are depositing funds into the intense contract. And then that contract keeps track of your respective token balances until you are ready to withdraw them.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=563s"},{"start_seconds":574,"text":"All right. Now that you know the difference between intents versus origin chain, a lot of these parameters will now make a lot more sense and be more straightforward. So the next parameter is going to be the destination asset.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=574s"},{"start_seconds":585,"text":"This is the this is the token that you'll be swapping for. Um or your output token again using that asset ID","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=585s"},{"start_seconds":591,"text":"that we went over earlier. You have your amount which is the amount that you're going to swap for. It's important to note that this is represented in the","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=591s"},{"start_seconds":599,"text":"token smallest unit and will be based on either the input or output token amount.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=599s"},{"start_seconds":605,"text":"We have our refund to address. This is the address that will receive all funds in case the swap fails. And the type of refund address. So this is going to be","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=605s"},{"start_seconds":612,"text":"the origin chain or intense. So, if you want to refund all of the funds to the address that's on the intense contract,","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=612s"},{"start_seconds":620,"text":"you can do that. Or on the destination chain or the origin chain, you can do that.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=620s"},{"start_seconds":626,"text":"You have the recipient address and then the recipient type. So, is this address that's receiving the funds, is it on the destination chain or is it an address within the near intent smart contract?","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=626s"},{"start_seconds":638,"text":"You have a deadline which is set to execute 3 minutes from now. This can be changed.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=638s"},{"start_seconds":644,"text":"You have a referral which is a referral identifier for fee sharing or tracking.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=644s"},{"start_seconds":649,"text":"And then the maximum time to wait for the quote response. And then once you have that all configured, we just call one method from the one-click service","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=649s"},{"start_seconds":658,"text":"imported from our TypeScript SDK earlier. And that method is get quote and we pass it the quote request. So","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=658s"},{"start_seconds":666,"text":"let's go ahead and go back to our configured swap. Uh again this is our example configuration. We have it set to","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=666s"},{"start_seconds":674,"text":"true for testing. We have the sender address that is configured in our env account uh as a near account. We have a","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=674s"},{"start_seconds":681,"text":"recipient address. This is going to be for the destination chain that I am swapping for. I am going to be um using","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=681s"},{"start_seconds":688,"text":"arbitum in my example. So this is my arbitum address. We have the origin asset which is represented as native near. Uh one click automatically wraps","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=688s"},{"start_seconds":697,"text":"our near for us. So we don't need to worry about that. But the asset ID is wrap.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=697s"},{"start_seconds":702,"text":"And then the destination address. So this is the address we found on our get quote endpoint that we did in step one. This is native arbitrum.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=702s"},{"start_seconds":711,"text":"And the amount. So this is the total amount that I'm going to swap for. I'm actually going to change this value to 01 uh just for my testing purposes.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=711s"},{"start_seconds":721,"text":"Let's test it. So we'll go ahead and open back up our terminal. Now run pmpm get quote.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=721s"},{"start_seconds":732,"text":"All right. And we have our quote. So as you can see these are all the parameters that we sent to it. This is our quote request that we sent out. And here's the","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=732s"},{"start_seconds":740,"text":"response that we got. Um this is the amount that we're swapping for in again in the smallest unit. It's formatted as 01 near which uh is about 3 cents USD.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=740s"},{"start_seconds":750,"text":"And this is the amount that we will receive.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=750s"},{"start_seconds":754,"text":"So, this looks all good to me. Let's go ahead and actually do an actual swap.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=754s"},{"start_seconds":762,"text":"So, we'll go ahead and change this to false. Open back up our terminal.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=762s"},{"start_seconds":771,"text":"Run it again.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=771s"},{"start_seconds":777,"text":"And now you can see we have a deposit address, a deadline, and time when inactive. Now to send this, we don't","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=777s"},{"start_seconds":786,"text":"necessarily need to run this script here. We could test it out by just grabbing this deposit address and then opening up a wallet.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=786s"},{"start_seconds":796,"text":"So I'll go ahead and go to my wallet. I'll go to send.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=796s"},{"start_seconds":801,"text":"I will send 01 near to this account address","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=801s"},{"start_seconds":810,"text":"and hit continue. Says account doesn't exist yet. It'll be created on deposit. That is exactly what we want.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=810s"},{"start_seconds":818,"text":"All right. Token sent successfully.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=818s"},{"start_seconds":822,"text":"So now we can go to our intents explorer and if we want we can monitor this intent by pasting in that deposit address.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=822s"},{"start_seconds":835,"text":"Ah and you can see it is processing.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=835s"},{"start_seconds":843,"text":"So we can see that was created. The deposit is complete and all right. Yeah looks like we did a successful swap.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=843s"},{"start_seconds":851,"text":"And if we keep scrolling down, we can see our destination chain transaction.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=851s"},{"start_seconds":856,"text":"We look at arbit scan. See this was successful.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=856s"},{"start_seconds":861,"text":"And we can take a look at our near transactions.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=861s"},{"start_seconds":868,"text":"See all those individual transactions on the near side.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=868s"},{"start_seconds":877,"text":"All right. So, we've completed a successful swap. And now you can see where earlier I was saying you don't necessarily need a near account uh to","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=877s"},{"start_seconds":886,"text":"perform any of this because the sender address and the recipient address could be non-native near addresses. Um so yeah, if I wanted to take my arbitum","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=886s"},{"start_seconds":894,"text":"address and put that where my sender address was and now say I have a different address on a different network, I can put that value there. I","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=894s"},{"start_seconds":902,"text":"can get my quote and then I just send um a deposit on that native network. To give you a quick demo on how this would work, let's modify our swap","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=902s"},{"start_seconds":910,"text":"configuration values and we'll get a new quote that doesn't involve any near native asset swapping. Um so now that we've swapped some near for arbitum on","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=910s"},{"start_seconds":919,"text":"this account, we can go ahead and use that account as the sender address and","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=919s"},{"start_seconds":926,"text":"we'll swap arbitrum for another token on a separate network. um we can make things easy for us and just choose","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=926s"},{"start_seconds":934,"text":"another L2 network so we can reuse this address and the origin asset will be","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=934s"},{"start_seconds":939,"text":"updated to our arbitrum token and then for the destination asset let's","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=939s"},{"start_seconds":948,"text":"go ahead and choose a token on another L2","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=948s"},{"start_seconds":955,"text":"we will select um let's go with optimism So we are going to swap for native op.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=955s"},{"start_seconds":967,"text":"We'll go ahead and copy this value and paste it as our destination asset","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=967s"},{"start_seconds":977,"text":"and the amount. So again this has to be the token amount that's in the smallest unit. Here is a helper file that we use to convert our near to yaktonir which is","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=977s"},{"start_seconds":986,"text":"10^ the - 24th. I believe arbitrum uses 10 to the 18th and uh we can double check that by going to an explorer go to","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=986s"},{"start_seconds":995,"text":"arbitum and they have a unit converter here on arbbercan and yeah it's 10 to the 18th for one arb.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=995s"},{"start_seconds":1006,"text":"Let's go back here. Let's paste in this amount. And this is as a string.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=1006s"},{"start_seconds":1013,"text":"And all right. So, we are going to swap from our arbitrum account to an account that we're going to create on the","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=1013s"},{"start_seconds":1021,"text":"optimism network. We're going to have the origin asset as arbitum and then the destination asset is going to be optimism on the optimism network. Um, so","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=1021s"},{"start_seconds":1029,"text":"yeah, we can check in our MetaMask and see. Yep, we have um some tokens on","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=1029s"},{"start_seconds":1037,"text":"arbitrum and on optimism we have a zero balance here. So um with a successful","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=1037s"},{"start_seconds":1044,"text":"swap, this value should um give us one optimism token. So let's go back here and let's get our quote.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=1044s"},{"start_seconds":1055,"text":"So we'll do pmppm get quote.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=1055s"},{"start_seconds":1064,"text":"All right. And yeah, we have the correct amount formatted. One token in and we will get just about half of an optimism","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=1064s"},{"start_seconds":1073,"text":"token and the amount in is 40 cents, amount out is 38 cents. So yeah, spending about penny and a half for the","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=1073s"},{"start_seconds":1080,"text":"swap. Cool. So this looks good. Let's grab this deposit address. And this is a deposit address that is on the arbitum network.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=1080s"},{"start_seconds":1095,"text":"So, we'll go back here. We'll go to Arbitum.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=1095s"},{"start_seconds":1099,"text":"We'll send here paste in our deposit address. And we'll select arbitum. And we are going to send one ARB to this deposit address.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=1099s"},{"start_seconds":1111,"text":"We'll hit continue. And looks like we'll pay 2 cents ETH. Go ahead and confirm.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=1111s"},{"start_seconds":1121,"text":"All right, transaction looks like it's complete. So again, we can go back to","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=1121s"},{"start_seconds":1128,"text":"our intense explorer. We can paste in the deposit address and we can see that this is now processing.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=1128s"},{"start_seconds":1144,"text":"So it's created, deposits complete, and now it is processing.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=1144s"},{"start_seconds":1151,"text":"and complete. Awesome. So we can see now the transaction is complete and we can","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=1151s"},{"start_seconds":1159,"text":"view the transactions on the destination chain of optimism and also see the transactions that took place on the near network. Uh but again","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=1159s"},{"start_seconds":1167,"text":"we didn't actually need a near account for any of this to work. These are all the transactions that took place under the hood uh using oneclick API.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=1167s"},{"start_seconds":1181,"text":"And we can go to our MetaMask account and check our balances.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=1181s"},{"start_seconds":1186,"text":"And yeah, here we go. Now we have Optimism in our previously unfunded account. And again, this was used just","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=1186s"},{"start_seconds":1193,"text":"from one arbitum account to one optimism account, both using Ethereum L2s with no near account actually required to perform the transaction.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=1193s"},{"start_seconds":1205,"text":"All right, so that's get quote. Um, the rest of these files are kind of just going over what you already know. Um,","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=1205s"},{"start_seconds":1213,"text":"this is a send deposit script. Um, this uses near APIJS um to send tokens using your private key","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=1213s"},{"start_seconds":1222,"text":"that is that was configured in your end file. Um, this just yeah uh basic functionality of how near works for","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=1222s"},{"start_seconds":1229,"text":"getting an account and transferring tokens over. You can find more about this in our documentation online at docs.near.org.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=1229s"},{"start_seconds":1238,"text":"And we have those two optional endpoints for oneclick API. Uh one of them is submitting the transaction hash to oneclick. Um this just speeds up the","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=1238s"},{"start_seconds":1247,"text":"process um by early notification to oneclick API that a swap has taken place. And again this um everything you","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=1247s"},{"start_seconds":1255,"text":"know from the TypeScript SDK uses this one-click service um and it will call submit deposit transaction and then you","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=1255s"},{"start_seconds":1262,"text":"just uh deposit the transaction hash along with the deposit address that you sent that to. And then we also have that","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=1262s"},{"start_seconds":1270,"text":"optional check status endpoint. Um, and this is where we can check the status of the ongoing swap.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=1270s"},{"start_seconds":1278,"text":"Again, using the one-click service import, uh, and calling get execution status based on the deposit address.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=1278s"},{"start_seconds":1288,"text":"So, finally, we have this file here that uses all of these steps above uh, steps two through five. And, um, please note","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=1288s"},{"start_seconds":1297,"text":"that this file is configured differently uh, than the other file. So if you um configured get quote earlier um these are the values that you're going to use","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=1297s"},{"start_seconds":1306,"text":"for a full swap. Um so in here I have my near sender account. I have my private key. Um again that's set up in my M","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=1306s"},{"start_seconds":1315,"text":"file. Um I have my recipient address which is my arbitum address and now my optimism address as well. Um and then this is my origin asset. that I have","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=1315s"},{"start_seconds":1323,"text":"native near my destination asset which is going to be native ARB and then the amount that I want to swap for. And you can play with any one of these values.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=1323s"},{"start_seconds":1333,"text":"Um and then what it does is it basically just imports um all of those functions from the earlier steps and calls them one by one. So first we get a quote.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=1333s"},{"start_seconds":1345,"text":"Then after the quote, um, we'll go ahead and display the swap cost to kind of give a the user a breakdown. Uh, then in step two, we'll send the deposit over.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=1345s"},{"start_seconds":1356,"text":"After a deposit has been sent, we'll do that optional submitting the transaction hash to one click. Then we're going to pull the status until there's a","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=1356s"},{"start_seconds":1364,"text":"successful result. Um, and then after the result, we'll give the user um a link to the uh transaction that they can view it.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=1364s"},{"start_seconds":1375,"text":"So yeah, let's go ahead and try this out. Let's go go PMPM full swap.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=1375s"},{"start_seconds":1382,"text":"And it starts with step one by getting our quote.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=1382s"},{"start_seconds":1385,"text":"All right, we got our quote for 01 near uh 4.065 arbitum. Uh we have our deposit address","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=1385s"},{"start_seconds":1393,"text":"and a little swap cost breakdown table here that explains that yeah, we're basically paying 04 cents for the swap.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=1393s"},{"start_seconds":1401,"text":"Um, we can go and check our deposit, make sure that it was successful on near blocks, which it says it was.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=1401s"},{"start_seconds":1413,"text":"And yeah, now we are monitoring our swap status as it's showing us pending and processing.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=1413s"},{"start_seconds":1421,"text":"And now a success.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=1421s"},{"start_seconds":1424,"text":"And let's go ahead and view our final transaction on the Near Intense Explorer.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=1424s"},{"start_seconds":1429,"text":"All right, perfect. Looks like uh yeah we created deposit process and withdrew our funds from the account into our","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=1429s"},{"start_seconds":1436,"text":"arbitum account and successfully swapped 01 near for 065 arbitum.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=1436s"},{"start_seconds":1444,"text":"All right, thanks so much for watching.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=1444s"},{"start_seconds":1445,"text":"I hope this workshop was helpful for you. Um here you'll find some near intense resources that are super helpful. You have the examples repo that","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=1445s"},{"start_seconds":1453,"text":"we were working with at the top. Uh official documentation for nearintense at docs.nearintense.org.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=1453s"},{"start_seconds":1459,"text":"And if anytime you need live support, uh the team's always willing to help on our Telegram support chat near intense.","url":"https://www.youtube.com/watch?v=U8ngm2hR4a4&t=1459s"}],"youtube_url":"https://youtube.com/watch?v=U8ngm2hR4a4","url":"https://near-pedia.xyz/videos/U8ngm2hR4a4"}