Vijay R

Vijay R

1674284493

Flutter Schedule Notification Tutorial

Check out how to schedule notifications in Flutter: 
https://youtu.be/T6Wg0AmIESE

Visit my channel for more awesome flutter contents: 
https://lnkd.in/gYh4HAfD

 

#animation #flutter #flutterdev #mobile #mobileapp #appdesign #flutterapp #appdev #mobileapp #developer #ui #ux #dev

Flutter Schedule Notification Tutorial

Ethereum's Missing P2p NFT and token Swap Library for Web3 Developers

Swap SDK

The missing peer-to-peer swap library for Ethereum and EVM-compatible chains, powered by the 0x protocol, written in TypeScript for web3 developers. Trade tokens (ERC20s), NFTs, and other collectibles (ERC721 and ERC1155) with just a few lines of code. Seriously, easily trade anything on Ethereum with this library.

🎉 Update 1/31/22: Swap SDK now supports 0x v4, check out the docs. 🎉

Overview

tl;dr: NFT Swap SDK is the easiest, most-powerful swap library available on the EVM. Supports Ethereum and EVM-compatible chains (Polygon, Avalanche, BSC, etc.). Works in both browser and Node.js. Written in TypeScript, built using the 0x protocol. With this library, you can build support for NFT marketplaces, over-the-counter (OTC) exchanges, and/or peer-to-peer exchanges.

The NFT Swap SDK developed by Trader.xyz offers swap support for ERC20s, ERC721s, and ERC1155s. Exchange NFTs for NFTs, NFTs for ERC20 tokens, or bundles of NFTs and tokens. This library provides the ultimate swap flexibility combined with a simple API surface area so you can be productive immediately and focus on building your web3 app.

This library is powered and secured by the 0x v3 protocol. The 0x v3 protocol has been in production for multiple years securing billions of dollars with of trades.

Goals

We want to share all underlying technology trader.xyz uses with the community. While we won't be open-sourcing our frontend, as we think design and UX is our differentiator, we believe in open-sourcing and freely sharing all underlying technology.

Our end goal is every piece of tech you see trader.xyz use (protocol, swap libraries, open-source orderbook, order monitor, high-performance NFT indexer, property-based orders, specific React hooks, and NFT aggregation) end up open-source. This library is the first step to achieving our goal.

Installation

You can install the SDK with yarn:

yarn add @traderxyz/nft-swap-sdk

or npm:

npm install @traderxyz/nft-swap-sdk

You can check out an example project here or check out the example repo here

Configuration

To use the SDK, create a new NftSwap instance.

import { NftSwap } from '@traderxyz/nft-swap-sdk';

// From your app, provide NftSwap the web3 provider, signer for the user's wallet, and the chain id.
const nftSwapSdk = new NftSwap(provider, signer, chainId);

Now you're set up and ready to use the SDK in your program. Check out the examples below to learn how to swap with the library.

Examples

Example 1: NFT <> NFT swap

In this first example, we're going to do a 1:1 NFT swap. We're going to swap User A's CryptoPunk NFT for User B's Bored Ape NFT.

Terminology: maker: Since User A will initiate the trade, we'll refer to User A as the maker of the trade.

Terminology: taker: Since User B will be filling and completing the trade created by User A, we'll refer to User B as the taker of the trade.

// Setup the sample data...
const CHAIN_ID = 1; // Chain 1 corresponds to Mainnet. Visit https://chainid.network/ for a complete list of chain ids

const CRYPTOPUNK_420 = {
  tokenAddress: '0xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb', // CryptoPunk contract address
  tokenId: '420', // Token Id of the CryptoPunk we want to swap
  type: 'ERC721', // Must be one of 'ERC20', 'ERC721', or 'ERC1155'
};

const BORED_APE_69 = {
  tokenAddress: '0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D', // BAYC contract address
  tokenId: '69', // Token Id of the BoredApe we want to swap
  type: 'ERC721',
};

// User A Trade Data
const walletAddressUserA = '0x1eeD19957E0a81AED9a80f09a3CCEaD83Ea6D86b';
const assetsToSwapUserA = [CRYPTOPUNK_420];

// User B Trade Data
const walletAddressUserB = '0x44beA2b43600eE240AB6Cb90696048CeF32aBf1D';
const assetsToSwapUserB = [BORED_APE_69];

// ............................
// Part 1 of the trade -- User A (the 'maker') initiates an order
// ............................

// Initiate the SDK for User A.
// Pass the user's wallet signer (available via the user's wallet provider) to the Swap SDK
const nftSwapSdk = new NftSwap(provider, signerUserA, CHAIN_ID);

// Check if we need to approve the NFT for swapping
const approvalStatusForUserA = await nftSwapSdk.loadApprovalStatus(
  assetsToSwapUserA[0],
  walletAddressUserA
);
// If we do need to approve User A's CryptoPunk for swapping, let's do that now
if (!approvalStatusForUserA.contractApproved) {
  const approvalTx = await nftSwapSdk.approveTokenOrNftByAsset(
    assetsToSwapUserA[0],
    makerAddress
  );
  const approvalTxReceipt = await approvalTx.wait();
  console.log(
    `Approved ${assetsToSwapUserA[0].tokenAddress} contract to swap with 0x (txHash: ${approvalTxReceipt.transactionHash})`
  );
}

// Create the order (Remember, User A initiates the trade, so User A creates the order)
const order = nftSwapSdk.buildOrder(
  assetsToSwapUserA,
  assetsToSwapUserB,
  walletAddressUserA
);
// Sign the order (User A signs since they are initiating the trade)
const signedOrder = await nftSwapSdk.signOrder(order, makerAddress);
// Part 1 Complete. User A is now done. Now we send the `signedOrder` to User B to complete the trade.

// ............................
// Part 2 of the trade -- User B (the 'taker') accepts and fills order from User A and completes trade
// ............................
// Initiate the SDK for User B.
const nftSwapSdk = new NftSwap(provider, signerUserB, CHAIN_ID);

// Check if we need to approve the NFT for swapping
const approvalStatusForUserB = await nftSwapSdk.loadApprovalStatus(
  assetsToSwapUserB[0],
  walletAddressUserB
);
// If we do need to approve NFT for swapping, let's do that now
if (!approvalStatusForUserB.contractApproved) {
  const approvalTx = await nftSwapSdk.approveTokenOrNftByAsset(
    assetsToSwapUserB[0],
    walletAddressUserB
  );
  const approvalTxReceipt = await approvalTx.wait();
  console.log(
    `Approved ${assetsToSwapUserB[0].tokenAddress} contract to swap with 0x. TxHash: ${approvalTxReceipt.transactionHash})`
  );
}
// The final step is the taker (User B) submitting the order.
// The taker approves the trade transaction and it will be submitted on the blockchain for settlement.
// Once the transaction is confirmed, the trade will be settled and cannot be reversed.
const fillTx = await nftSwapSdk.fillSignedOrder(signedOrder);
const fillTxReceipt = await nftSwapSdk.awaitTransactionHash(fillTx.hash);
console.log(`🎉 🥳 Order filled. TxHash: ${fillTxReceipt.transactionHash}`);

Example 2: Swap bundles -- Bundle of mixed ERC721s and ERC20 <> Bundle of ERC20s

Here we show an example of what the swap library is capable of. We can even swap arbitrary ERC tokens in bundles. We call it a bundle when we have more than one item that a party will swap. Bundles can have different ERC types within the same bundle.

In other words, we can swap [ERC721, ERC1155, ERC20] <> [ERC721, ERC1155, ERC20]. There's really no limit to what we can swap.

More concrete example: We can swap [2 CryptoPunks and 1,000 DAI] for [420 WETH and 694,200 USDC]. In this case we'd be swapping two ERC721s and an ERC20 (Punk NFT and DAI, respectively) for two ERC20s (WETH and USDC).

This is just one example. In reality, you can swap as many things as you'd like, any way you'd like. The underlying 0x protocol is extremely flexible, and the NFT swap library abstracts all the complexity away so you don't have to worry about protocol nuances.

// Set up the sample data for the swap...
const CHAIN_ID = 1; // Mainnet

const CRYPTOPUNK_420 = {
  tokenAddress: '0xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb',
  tokenId: '420',
  type: 'ERC721',
};

const CRYPTOPUNK_421 = {
  tokenAddress: '0xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb',
  tokenId: '421',
  type: 'ERC721',
};

const ONE_THOUSAND_DAI = {
  tokenAddress: '0x6b175474e89094c44da98b954eedeac495271d0f', // DAI contract address
  amount: '1000000000000000000000', // 1,000 DAI (DAI is 18 digits) -- amount to swap
  type: 'ERC20',
};

const SIXTY_NINE_USDC = {
  tokenAddress: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', // USDC contract address
  amount: '69000000', // 69 USDC (USDC is 6 digits)
  type: 'ERC20',
};

const FOUR_THOUSAND_TWENTY_WETH = {
  tokenAddress: '0x6b175474e89094c44da98b954eedeac495271d0f', // WETH contract address
  amount: '420000000000000000000', // 420 Wrapped-ETH (WETH is 18 digits)
  type: 'ERC20',
};

// User A Trade Data
const walletAddressUserA = '0x1eeD19957E0a81AED9a80f09a3CCEaD83Ea6D86b';
const assetsToSwapUserA = [CRYPTOPUNK_420, CRYPTOPUNK_421, ONE_THOUSAND_DAI];

// User B Trade Data
const walletAddressUserB = '0x44beA2b43600eE240AB6Cb90696048CeF32aBf1D';
const assetsToSwapUserB = [SIXTY_NINE_USDC, FOUR_THOUSAND_TWENTY_WETH];

// ............................
// Part 1 of the trade -- User A (the 'maker') initiates an order
// ............................
const nftSwapSdk = new NftSwap(provider, signerUserA, CHAIN_ID);
// Note: For brevity, we assume all assets are approved for swap in this example.
// See previous example on how to approve an asset.

const order = nftSwapSdk.buildOrder(
  assetsToSwapUserA,
  assetsToSwapUserB,
  walletAddressUserA
);
const signedOrder = await nftSwapSdk.signOrder(order, makerAddress);

// ............................
// Part 2 of the trade -- User B (the 'taker') accepts and fills order from User A and completes trade
// ............................
const nftSwapSdk = new NftSwap(provider, signerUserB, CHAIN_ID);

const fillTx = await nftSwapSdk.fillSignedOrder(signedOrder);
const fillTxReceipt = await nftSwapSdk.awaitTransactionHash(fillTx);
console.log(`🎉 🥳 Order filled. TxHash: ${fillTxReceipt.transactionHash}`);

// Not so bad, right? We can arbitrarily add more assets to our swap without introducing additional complexity!

Example 3: React Hooks + Swap SDK

In this example, we'll leverage the amazing web3-react React Hook library.

const App = () => {
  const { library, chainId } = useWeb3React<Web3React>();

  const [swapSdk, setSwapSdk] = useState(null);
  useEffect(() => {
    const sdk = new NftSwap(library, library.getSigner(), chainId);
    setSwapSdk(sdk);
  }, [library, chainId])

  // Use the SDK however you'd like in the app...
  const handleClick = useCallback(() => {
    if (!swapSdk) {
      return;
    }
    swapSdk.buildOrder(...)
  }, [swapSdk])

  // ...
}

FAQ

Which ERCs does this library support?

  • ERC20, ERC721, and ERC1155

What EVM chains are currently supported?

  • Mainnet (1)
  • Kovan (42)
  • Rinkeby (4)
  • Polygon (137)
  • Binance Smart Chain (56)
  • Avalanche (43114)

What protocol does this library use?

  • trader.xyz and trader.xyz libraries are powered by 0x v3 Protocol. This protocol is mature and lindy, and has been extremely well-audited.
  • Check out the 0x v3 spec here
  • Check out the 0x v3 Consensys audit here

Are there any protocol fees to execute swaps?

  • No

How do I get the user's signer object?

  • Generally you can get it from the user's web3 wallet provider, by something like this: provider.getSigner().
  • See this ethers guide (control-f for getSigner).
  • In web3-react you can do:
    • const { library } = useWeb3React();
    • const signer = library.getSigner();

How do I store a SignedOrder

  • That's up to you. This library has no opinions on how to store orders. You can throw them in a centralized SQL database, save them to localstorage, use a decentralized messaging solution -- it's really up to you and your app concerns. You can even serialize and compress an order to fit in a tweet or shareable URL! 🤯

Support

For personalized help, please join the #dev-help channel in our Discord: https://discord.gg/RTvpQcxn4V

For general documentation, check out https://docs.swapsdk.xyz

Roadmap

We're currently working on the following features for the next iteration of this library:

  • ✅ LIVE -- Persistent data store of orders (off-the-shelf storage in trader.xyz's public order storage server). Think of it as a public good
  • ✅ LIVE -- Property-based orders
  • ✅ LIVE -- Order validation
  • ✅ LIVE -- Live order status
  • Order event streaming via WebSockets

If you have feature requests, reach out in our Discord.

We want to make this library a one-stop shop for all your NFT swapping needs.


Download details:

Author: trader-xyz
Source code: https://github.com/trader-xyz/nft-swap-sdk

License: MIT license

#nft #blockchain #bitcoin #Web3   

Ethereum's Missing P2p NFT and token Swap Library for Web3 Developers

Understanding The New Angular Dev Tools!

tldr;

They're here! After a long time of people hoping and asking for some dev tools to work with their Angular apps, there is now a new Chrome extension for Angular dev tools. The Angular team has worked really hard on this, and I'm excited to introduce you to it in this blog post.

In short, the new dev tools extension will let you view the layout of your app in a tree-like structure. You can click on each component and see its properties, and see where exactly on the page that component is. Let's look at this a little more in depth.

Dev Tools Demo

Let's start with where you can get the dev tools. You can add the dev tools to your browser through the Chrome extension store.

After the dev tools are installed, open the Chrome developer tools panel and look for the "Angular" option and click on it.

Angular dev tools tab selection

This will show the dev tools for you, starting with the root component of your application.

Angular dev tools showing the root of the application

There's not a lot here, due to my demo app being pretty simple, but the left half of the window shows the components of the app in a tree structure. Currently, it's all collapsed down to the app-root component. The right hand side shows the properties of the selected component. In this case, all there is to show is the change detection strategy and the view encapsulation. We'll look at other components with more information next.

Angular dev tools showing the app-nav component

In this image I opened up the app-root node of the tree so that we can see the app-nav component. I then clicked on the app-nav component. In the right hand side we can see the properties of the component. At the top we can see the view encapsulation again, as well as the change detection strategy. Underneath that are the class member variables for the component. In this case, it's an array of links to show in the navigation. Each link is opened up to see the attributes it contains.

This is another simple situation, but it demonstrates the potential power of the dev tools. Being able to see the properties of the component and the values of the properties is really powerful.

Let's look at another couple components in the app, this time the app-todos component and app-todo component.

Angular dev tools showing the app-todos component

In this component, we see two properties: the injected _json service and the todos$ observable. I've clicked on the app-todos component, but there's nothing below it. There should be a list of todos, right? To get them to show up, you need to click on the cog right above the search components input.

Angular dev tools options menu

Clicking on the cog will open a small options menu. The items in the menu are "Enable timing API", "Dark Mode", and "Show comment nodes". The one we're interested in for right now is the "Show comment nodes" option. Selecting this option will make the app-todo components show up. Let's select a todo component and see what it looks like.

Angular dev tools showing the app-todo component

This component looks similar to some of the other ones that we've seen, but there are more attributes visible on the component. We can see the @Inputs and @Outputs, as well as the attributes available on those items. For the todo input, we can see the value of each attribute. Being able to drill down into components and see the values of the attributes is really beneficial and valuable.

The last part of the dev tools that I want to point out is the profiler, which will allow you to click around the app and then view information about a particular change detection cycle. The tools tell you how long it took, as well as which components were affected and how much they were affected in a given cycle. If your application is running slowly and you're unsure where the hold up is, this profiler can be a big help. Below are a few images of the profiler in action.

Angular dev tools profiler

To view this starting page of the profiler, click on the "Profiler" tab next to components. After doing that, click on the gray button to the left of the information in the tab. This will start the recording, and the tools will update:

Angular dev tools profiler recording

After starting the recording, click around your app. Each change detection cycle will be recorded by the profiler, and will be shown in a bar chart by default. Click on one of the bars to view more information about that cycle.

Angular dev tools profiler showing bar chart

Angular dev tools profiler showing details of a cycle

The detailed view shows you what actions took up certain amounts of time in each detection cycle that was run.

Once you're done, click on the red dot to end you profiler session.

Conclusion

I hope this brief introduction to the Angular dev tools is helpful! I'm really excited to have some dedicated tools to help debug and learn more about my Angular application. I'm sure more features will be added, and if there's a feature you would like check out the repo and submit issues and pull requests!

Original article source at: https://www.prestonlamb.com/

#angular #dev #tools 

Understanding The New Angular Dev Tools!
Gordon  Matlala

Gordon Matlala

1667379360

Dev-curriculum: Instant Web Curriculum Generator for Developers

Dev Curriculum

Instant web curriculum generator for developers

What is this?

Dev Curriculum is the fastest and simplest way to make a web curriculum for developers.

In few minutes you can have your own Web Curriculum for free using Dev Curriculum and Github Pages.

What is a web curriculum?

It's the reduced version of a Curriculum Vitae, but made as a web page.

Who this is made for?

Any developer that doesn't have a Web Curriculum.

How it will look like?

I ain't just developed Dev Curriculum, I'm also using it as my own Web Curriculum and you can check a demo here.

How to use

First of all make sure you have ruby installed and bundle as well, if not, have refer to the the ruby official website at ruby.com and bundle official website at bundler.io

Once you have all environment set up done go ahead and follow the steps below:

Step 1 - Fork Dev Curriculum to your User Repository

Fork this repository, then rename the repository to your-github-username.github.io. Example: wendelladriel.github.io. In order to rename, go to you forked repository and click in settings

settings.png

At this moment the Web Curriculum will often be viewable immediately at http://your-github-username.github.io. But you may need do some changes to make you curriculum as you wish.

Step 2 - Customize your Web Curriculum

To customize your Web Curriculum you will change only two files:

  • _config.yml: in this file you have to put your personal informations and skills list
  • css/_variables.sass: in this file you can change the colors to customize the appearance of your Web Curriculum

Step 3 - Publish your Web Curriculum

obs: In this stage you can edit your files on the fly by github interface, or if you prefer locally as well.

After you made the changes, just commit and push to your repository and your Web Curriculum is ready, just go to http://your-github-username.github.io and see your new awesome Web Curriculum!!!

Changelog

You can see all the important changes here

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/WendellAdriel/dev-curriculum/. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

Download Details:

Author: WendellAdriel
Source Code: https://github.com/WendellAdriel/dev-curriculum 
License: MIT license

#jekyll #ruby #dev #web 

Dev-curriculum: Instant Web Curriculum Generator for Developers
Rupert  Beatty

Rupert Beatty

1666206840

DevUtils-app: All-in-one toolbox for Developers. Native MacOS App

DevUtils.app

Developer Utilities for macOS

Format/Validate JSON, encode/decode Base64, convert timestamps, debug JWT… with just one click! Native macOS app and works offline.

A friendly note ❤️

DevUtils is a paid "source-available" app. That means I'm selling the pre-built version of the app. It takes time and effort to develop, distribute, maintain, and provide supports. If you like the app, please consider buying here (one-time purchase). That would help me a lot! Thank you very much! 🙏

Source code

This source code is a delayed version of DevUtils.

Development environment:

  • Swift 5.1+
  • Xcode 11.1+
  • Swift Package Manager
  • Carthage

Build Instructions

Clone repository.

Bootstrap carthage, this will install the required dependencies for the app:

carthage bootstrap --platform macOS

Update signing Team to be your Personal or organizational Team in Xcode. This is needed to build the app locally. If you have problems with code signing, please also check these articles to see if it helps:

Run the app in Xcode.

Contributing

Please see CONTRIBUTING.md

Contact

Download Details:

Author: DevUtilsApp
Source Code: https://github.com/DevUtilsApp/DevUtils-app 
License: View license

#swift #dev #utils #macos 

DevUtils-app: All-in-one toolbox for Developers. Native MacOS App

KNITRO.jl: Julia interface to The Artelys Knitro Solver

KNITRO.jl

KNITRO.jl is a Julia interface to the Artelys Knitro solver.

It has two components:

Note: This wrapper is maintained by the JuMP community with help from Artelys. Please contact Artelys support if you encounter any problem with this interface or the solver.

Installation

First, purchase and install a copy of Knitro from Artelys.

Then, install KNITRO.jl using the Julia package manager:

import Pkg; Pkg.add("KNITRO")

KNITRO.jl is available free of charge and in no way replaces or alters any functionality of Artelys Knitro solver.

Troubleshooting

If you are having issues installing, here are several things to try:

Make sure that you have defined your global variables correctly, for example with export KNITRODIR="/path/to/knitro-vXXX-$OS-64" and export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$KNITRODIR/lib". You can check that KNITRO.jl sees your library with using KNITRO; KNITRO.has_knitro().

If KNITRO.has_knitro() returns false but you are confident that your paths are correct, try running build KNITRO and restarting Julia. In at least one user's experience, installing and using KNITRO in a temporary Julia environment (activated with ] activate --temp) does not work and the need to manually build is likely the reason why.

Use with JuMP

Use the KNITRO.Optimizer to use KNITRO with JuMP or MathOptInterface:

using JuMP
import KNITRO
model = Model(KNITRO.Optimizer)
set_optimizer_attribute(model, "honorbnds", 1)
set_optimizer_attribute(model, "outlev", 1)
set_optimizer_attribute(model, "algorithm", 4)

Use with AMPL

Pass KNITRO.amplexe to use KNITRO with the package AmplNLWriter.jl package:

using JuMP
import AmplNLWriter
import KNITRO
model = Model(() -> AmplNLWriter.Optimizer(KNITRO.amplexe, ["outlev=3"]))

Use with other packages

A variety of packages extend KNITRO.jl to support other optimization modeling systems. These include:

Low-level wrapper

KNITRO.jl implements most of Knitro's functionalities. If you aim at using part of Knitro's API that are not implemented in the MathOptInterface/JuMP ecosystem, you can refer to the low-level API, which wraps Knitro's C API (whose templates are specified in the file knitro.h).

Extensive examples using the C wrapper can be found in examples/.

Multithreading

Due to limitations in the interaction between Julia and C, KNITRO.jl disables multithreading if the problem is nonlinear. This will override any options such as par_numthreads that you may have set. Read GitHub issue #93 for more details.


KNITRO.jl underwent a major rewrite between versions 0.12.0 and 0.13.0, with the low-level wrapper now being generated automatically with Clang.jl. Users of JuMP should see no breaking changes, but if you used the lower-level C API you will need to update your code accordingly.


Download Details:

Author: Jump-dev
Source Code: https://github.com/jump-dev/KNITRO.jl 
License: View license

#julia #dev #interface 

KNITRO.jl: Julia interface to The Artelys Knitro Solver
Tech2 etc

Tech2 etc

1664804279

How do I start working as a freelancer?

To start freelancing while you already have a full-time job, you’ll have to consider the following steps:


How to start freelancing (even when working full-time)?

1. Define your business goals.
2. Find a perspective niche (and stick to it)
3. Identify target clients.
4. Set your freelance rates.
5. Create a website (and portfolio)
6. Find your first client.
7. Expand your network.
8. Balance your full-time job with your part-time freelancing side gigs.

Define your business goals

Before you start freelancing, you’ll have to be honest with yourself, and answer an important question:
* Is freelancing just a side gig? Or do you plan to expand it to a full-time business?

The answer to this question will determine your next steps, considering that you’ll either aim to balance your full-time and freelance work, OR aim to work your way out of your current job to pursue a full-time freelance career.

The answer to this question is your long-term goal. To pursue it, you’ll have to set a number of short-term goals and answer questions such as:

* What niche will you specialize in?
* What services will you offer?
* What amount do you want to be earning on a monthly basis to decide to quit your full-time job (if applicable)?

Find a perspective niche (and stick to it)

No matter whether you’re a graphic designer, copywriter, developer, or anything in between by vocation, it’d be best if you were to specialize in a particular area of work:

For example, If you’re a content writer, don’t aim to write about any topic under the sun, from Top 3 Ways to Prepare Your Garden for Spring to Taxation Laws in all 50 US States Explained.

Sure, you may start by writing various topics, to find your ideal niche, but eventually, you should pick one, and stick to it.

But, Cryptocurrency or Technology content writer always sound much better in your CV than General content writer. Moreover, they inspire more confidence in you on the part of the clients who’ll always be looking for specific, and not general content.

The same is true if you’re a graphic designer:
* consider your level of experience
* your current pool of connections
* your natural inclinations to a particular design niche

Then, make your pick — focus on delivering interface design for apps, creating new custom logos, devising layouts for books, or any other specific design work.

Identify target clients

Just like you shouldn’t aim to cover every niche in your industry, you shouldn’t aim to cater to the needs of the entire industry’s market.

Small businesses, teams, remote workers, or even other freelancers may all require the same type of service you’re looking to offer. But, you’ll need to target one or two types of clients especially.

Say you want to start a blog about everything related to working remotely. There are freelancers, teams, but also entire businesses working remotely, and they can serve as your starting point.

* Think about the age of your desired readers. Perhaps you’re a Millennial, so you can write a blog about working remotely for Millennials?
* Think about the location. Perhaps you want to cover predominantly the US market?
* Think about the education level. Perhaps you want to cover newly independent remote workers, who’re just starting out their careers?
* Think about income. Perhaps you’re looking to write for people with a limited budget, but who want to try digital nomadism?
* Think about gender. Perhaps you want to predominantly target women freelancers?

These are only some questions you should ask yourself, but they reveal a lot. For example, that you can write for fresh-out-of-college female Millennials from the US looking to start and cultivate a remote career while traveling abroad with a limited budget.

Set your freelance rates

Setting your freelance rates always seems like a challenging point, but it’s a lot more straightforward when you list the necessary parameters that help determine your ideal (and realistic) pricing:

* Experience (if any)
* Education level
* Supply and demand for your services
* The prices in your industry
* The average freelance hourly rates in your niche
* Your location

Once you have all this data, you’ll need to calculate your hourly rate based on it — higher education, experience, and demand for your niche will mean you can set higher prices. If you’re based in the US, you’ll likely be able to command higher rates than if you’re based in the Philippines. Of course, your living standards and expenses will be higher, so you’ll also need to command higher rates.

Create a website (and portfolio)

Once you’ve defined your business goals, found a niche, identified your target clients, and set your prices, you’ll want to create an online presence. And, the best way to do so is by creating your own website with a portfolio showcasing your previous work, skills, and expertise. There are plenty of amazing tutorials on YouTube.

Creating a website for free through a website builder like Wix is fine, but you’ll be better off if you were to buy a domain name from a hosting website. You’ll get a unique name for your online presence and a customized email address, so you’ll look much more credible and overall more professional to potential clients.

Regardless of what your industry is, it may be best if you were to choose your own name for the domain, especially when you’re mostly looking to showcase your portfolio. You’ll stand out better, and it’ll later be easier to switch to a different industry (or niche) if you find that you want to.

Once you’ve selected a host and domain name, you can install WordPress to your website, and choose the website’s theme. Then, you can add a landing page describing your services, and prices, maybe even a separate page for a blog where you’ll write about industry-related topics.

Find your first client

Your first client may contact you because of your personal website portfolio, but you should also actively pursue your first gig bearing in mind what employers look for. There are several ways you can do this:

* Get involved in your industry’s community
* Learn how to pitch through email
* Look through freelance job platforms/websites

Expand your network

Once you’ve landed your first client, you’ll need to work on finding recurring clients. Perhaps your first client will become a recurring one. And, perhaps the referral you’ve been given by said first client will inspire others to contact you and provide a steady stream of work.

In any case, it’s best that you expand your network — and here’s where the famous Pareto principle comes in handy. According to it, cultivating a good relationship with 20% of your clients will help you find 80% of new work through their referrals. Moreover, each new 20 referrals increase your chances of getting new projects by 80%.

To expand your network, you can:

* partake in industry webinars
* attend events
* join Facebook groups, pages and communities
* streamline your LinkedIn network
* send out invites to professionals in your field (or a field that often requires your services)

Work on additional skills

Apart from your core, industry-related freelance skills (i.e., your hard skills), you’ll need to work on some additional skills — your soft skills.

Soft skills are more personality-related: communicativeness and critical thinking are probably the most important traits to pursue, but, you’ll also need to be persistent, good at handling stress, an efficient scheduler, and skilled in time management.

The more you can skill up yourself, the more expensive you will become. Remember knowledge is priceless.

You’ll also need to be confident, to persuade your potential clients that you possess the skills and experience they’re looking for.

Conclusion

Entering the freelancing business may sound overwhelming and complicated, but it’s actually pretty straightforward, once you follow the right steps.

Take time and do what you find passionate about.

 

#freelance #freelancing #job #jobs #projects #money #earning #skills #dev 

How do I start working as a freelancer?
Python  Library

Python Library

1662656400

Free, Open Source Crypto Trading Bot Built on Python

Freqtrade 

Freqtrade is a free and open source crypto trading bot written in Python. It is designed to support all major exchanges and be controlled via Telegram or webUI. It contains backtesting, plotting and money management tools as well as strategy optimization by machine learning.

Features

  •  Based on Python 3.8+: For botting on any operating system - Windows, macOS and Linux.
  •  Persistence: Persistence is achieved through sqlite.
  •  Dry-run: Run the bot without paying money.
  •  Backtesting: Run a simulation of your buy/sell strategy.
  •  Strategy Optimization by machine learning: Use machine learning to optimize your buy/sell strategy parameters with real exchange data.
  •  Adaptive prediction modeling: Build a smart strategy with FreqAI that self-trains to the market via adaptive machine learning methods. Learn more
  •  Edge position sizing Calculate your win rate, risk reward ratio, the best stoploss and adjust your position size before taking a position for each specific market. Learn more.
  •  Whitelist crypto-currencies: Select which crypto-currency you want to trade or use dynamic whitelists.
  •  Blacklist crypto-currencies: Select which crypto-currency you want to avoid.
  •  Builtin WebUI: Builtin web UI to manage your bot.
  •  Manageable via Telegram: Manage the bot with Telegram.
  •  Display profit/loss in fiat: Display your profit/loss in fiat currency.
  •  Performance status report: Provide a performance status of your current trades.

Demo

freqtrade

Quick start

Please refer to the Docker Quickstart documentation on how to get started quickly.

For further (native) installation methods, please refer to the Installation documentation page.

Basic Usage

Bot commands

usage: freqtrade [-h] [-V]
                 {trade,create-userdir,new-config,new-strategy,download-data,convert-data,convert-trade-data,list-data,backtesting,edge,hyperopt,hyperopt-list,hyperopt-show,list-exchanges,list-hyperopts,list-markets,list-pairs,list-strategies,list-timeframes,show-trades,test-pairlist,install-ui,plot-dataframe,plot-profit,webserver}
                 ...

Free, open source crypto trading bot

positional arguments:
  {trade,create-userdir,new-config,new-strategy,download-data,convert-data,convert-trade-data,list-data,backtesting,edge,hyperopt,hyperopt-list,hyperopt-show,list-exchanges,list-hyperopts,list-markets,list-pairs,list-strategies,list-timeframes,show-trades,test-pairlist,install-ui,plot-dataframe,plot-profit,webserver}
    trade               Trade module.
    create-userdir      Create user-data directory.
    new-config          Create new config
    new-strategy        Create new strategy
    download-data       Download backtesting data.
    convert-data        Convert candle (OHLCV) data from one format to
                        another.
    convert-trade-data  Convert trade data from one format to another.
    list-data           List downloaded data.
    backtesting         Backtesting module.
    edge                Edge module.
    hyperopt            Hyperopt module.
    hyperopt-list       List Hyperopt results
    hyperopt-show       Show details of Hyperopt results
    list-exchanges      Print available exchanges.
    list-hyperopts      Print available hyperopt classes.
    list-markets        Print markets on exchange.
    list-pairs          Print pairs on exchange.
    list-strategies     Print available strategies.
    list-timeframes     Print available timeframes for the exchange.
    show-trades         Show trades.
    test-pairlist       Test your pairlist configuration.
    install-ui          Install FreqUI
    plot-dataframe      Plot candles with indicators.
    plot-profit         Generate plot showing profits.
    webserver           Webserver module.

optional arguments:
  -h, --help            show this help message and exit
  -V, --version         show program's version number and exit

Telegram RPC commands

Telegram is not mandatory. However, this is a great way to control your bot. More details and the full command list on the documentation

  • /start: Starts the trader.
  • /stop: Stops the trader.
  • /stopentry: Stop entering new trades.
  • /status <trade_id>|[table]: Lists all or specific open trades.
  • /profit [<n>]: Lists cumulative profit from all finished trades, over the last n days.
  • /forceexit <trade_id>|all: Instantly exits the given trade (Ignoring minimum_roi).
  • /fx <trade_id>|all: Alias to /forceexit
  • /performance: Show performance of each finished trade grouped by pair
  • /balance: Show account balance per currency.
  • /daily <n>: Shows profit or loss per day, over the last n days.
  • /help: Show help message.
  • /version: Show version.

Development branches

The project is currently setup in two main branches:

  • develop - This branch has often new features, but might also contain breaking changes. We try hard to keep this branch as stable as possible.
  • stable - This branch contains the latest stable release. This branch is generally well tested.
  • feat/* - These are feature branches, which are being worked on heavily. Please don't use these unless you want to test a specific feature.

Support

Help / Discord

For any questions not covered by the documentation or for further information about the bot, or to simply engage with like-minded individuals, we encourage you to join the Freqtrade discord server.

Bugs / Issues

If you discover a bug in the bot, please search the issue tracker first. If it hasn't been reported, please create a new issue and ensure you follow the template guide so that the team can assist you as quickly as possible.

Feature Requests

Have you a great idea to improve the bot you want to share? Please, first search if this feature was not already discussed. If it hasn't been requested, please create a new request and ensure you follow the template guide so that it does not get lost in the bug reports.

Pull Requests

Feel like the bot is missing a feature? We welcome your pull requests!

Please read the Contributing document to understand the requirements before sending your pull-requests.

Coding is not a necessity to contribute - maybe start with improving the documentation? Issues labeled good first issue can be good first contributions, and will help get you familiar with the codebase.

Note before starting any major new feature work, please open an issue describing what you are planning to do or talk to us on discord (please use the #dev channel for this). This will ensure that interested parties can give valuable feedback on the feature, and let others know that you are working on it.

Important: Always create your PR against the develop branch, not stable.

Requirements

Up-to-date clock

The clock must be accurate, synchronized to a NTP server very frequently to avoid problems with communication to the exchanges.

Minimum hardware required

To run this bot we recommend you a cloud instance with a minimum of:

  • Minimal (advised) system requirements: 2GB RAM, 1GB disk space, 2vCPU

Software requirements

Disclaimer

This software is for educational purposes only. Do not risk money which you are afraid to lose. USE THE SOFTWARE AT YOUR OWN RISK. THE AUTHORS AND ALL AFFILIATES ASSUME NO RESPONSIBILITY FOR YOUR TRADING RESULTS.

Always start by running a trading bot in Dry-run and do not engage money before you understand how it works and what profit/loss you should expect.

We strongly recommend you to have coding and Python knowledge. Do not hesitate to read the source code and understand the mechanism of this bot.

Supported Exchange marketplaces

Please read the exchange specific notes to learn about eventual, special configurations needed for each exchange.

Supported Futures Exchanges (experimental)

Please make sure to read the exchange specific notes, as well as the trading with leverage documentation before diving in.

Community tested

Exchanges confirmed working by the community:

Documentation

We invite you to read the bot documentation to ensure you understand how the bot is working.

Please find the complete documentation on the freqtrade website.

Download details:

Author: freqtrade
Source code: https://github.com/freqtrade/freqtrade
License: GPL-3.0 license

#python

Free, Open Source Crypto Trading Bot Built on Python
Michael Kitas

Michael Kitas

1661872278

Nodejs Puppeteer Tutorial #13 - Vercel Deployment CLI & GitHub

🧾This puppeteer tutorial is designed for beginners to learn how to use the node js puppeteer library to perform web scraping, web testing, and create website bots. Puppeteer is a Node library that provides a high-level API to control Chrome or Chromium over the DevTools Protocol. Puppeteer runs headless by default but can be configured to run full (non-headless) Chrome or Chromium.

⭐ Tags ⭐ - Nodejs Tutorials - Puppeteer Nodejs - Nodejs puppeteer tutorial - Puppeteer Tutorial for Beginners 
⭐ Hashtags ⭐ #nodejs  #javascript #node #web-development #express #dev 

Nodejs Puppeteer Tutorial #13 - Vercel Deployment CLI & GitHub

PkgDev.jl: Tools for Julia Package Developers

PkgDev

Overview

PkgDev provides tools for Julia package developers. The package is currently being rewritten for Julia 1.x and only for brave early adopters.

Usage

PkgDev.tag(package_name, version=nothing; registry=nothing, release_notes=nothing)

Tag a new release for package package_name. The package you want to tag must be deved in the current Julia environment. You pass the package name package_name as a String. The git commit that is the HEAD in the package folder will form the basis for the version to be tagged.

If you don't specify a version, then the version field in the Project.toml must have the format x.y.z-DEV, and the command will tag version x.y.z as the next release. Alternatively you can specify one of :major, :minor or :patch for the version parameter. In that case PkgDev.tag will increase that part of the version number by 1 and tag that version. Finally, you can also specify a full VersionNumber as the value for the version parameter, in which case that version will be tagged.

The only situation where you would specify a value for registry is when you want to register a new package for the first time in a registry that is not General. In all other situations, PkgDev.tag will automatically figure out in which registry your package is registered. When you do pass a value for registry, it should simply be the short name of a registry that is one of the registries your local system is connected with.

If you want to add custom release notes for TagBot, do so with the release_notes keyword.

PkgDev.tag runs through the following process when it tags a new version:

  1. Create a new release branch called release-x.y.z.
  2. Change the version field in Project.toml and commit that change on the release branch.
  3. Change the version field in Project.toml to x.y.z+1-DEV and commit that change also to the release branch. 4a. For packages in the General registry: add a comment that triggers Registrator. 4b. For packages in other registries: Open a pull request against the registry that tags the first new commit on the release branch as a new version x.y.z.
  4. Open a pull request against the package repository to merge the release branch into master.

If you have TagBot installed for your package with the branches: true setting, it will automatically merge the release-x.y.z branch into master once the pull request for the registry has been merged. If you use the package butler (desribed below) it auto-configures your repository for this workflow.

PkgDev.enable_pkgbutler(package_name; channel=:auto, template=:auto)

Enables the Julia Package Butler for package package_name. The package must be deved in the current Julia environment. The command will make various modifications to the files in the deved folder of the package. You then then need to commit these changes and push them to GitHub. The command will also add a deploy key to the GitHub repository of the package and show instructions on how to add two GitHub Actions secrets to the repository.

The channel argument can be :auto, :stable or :dev. There are two channels of updates: stable and dev. The dev channel will run the Julia Package Butler workflow every 5 minutes and it will use the master branch of the Julia Packge Butler engine, i.e. it will get new features more quickly. The stable branch runs the Julia Package Butler workflow every hour, and new features in the Julia Package Butler engine are only pushed out to the stable channel once they have been tested for a while on the dev channel. If you specify :auto as the argument, any existing channel choice you have previously made for the package will be retained, otherwise the package will be configure for the stable channel.

The template argument can be :auto, :default or :bach. Different templates will configure different aspects of your package. At this point everyone should use the :default template (or :auto template), everything else is considered experimental.

PkgDev.switch_pkgbutler_channel(package_name, channel)

Switch the Julia Package Butler channel for package package_name. The package you want to tag must be deved in the current Julia environment and the Julia Package Butler must already be enabled for the package. The channel argument can be :auto, :stable or :dev, see the documentation for PkgDev.enable_pkgbutler for an explanation of the different channels.

PkgDev.switch_pkgbutler_template(package_name, template)

Switch the Julia Package Butler template for package package_name. The package you want to tag must be deved in the current Julia environment and the Julia Package Butler must already be enabled for the package. The template argument can be :auto, :default or :bach.

PkgDev.format(package_name)

Format all the Julia source code files for the package with name package_name. The package you want to format must be deved in the current Julia environment. This function uses DocumentFormat.jl.

Download Details:

Author: JuliaLang
Source Code: https://github.com/JuliaLang/PkgDev.jl 
License: View license

#julia #tool #dev 

PkgDev.jl: Tools for Julia Package Developers
Tech2 etc

Tech2 etc

1660741784

React Navbar Tutorial - Responsive Navbar React JS

Advance React JS Responsive Navbar

Over the years, navigation bars, or navbars, have become a staple feature in building websites. They really come in handy for navigating across a website.

We will Create react navbar using advanced react js methods. In our previous tutorial, we have created a responsive navbar using basic react js. But in this tutorial we are going to use advance functionalities for creating this navbar using react js.

In this tutorial, we’ll go over the basics of building navbars in React. We’ll build a navbar that’s fixed to the top of the page, and the user will be able to switch between webpages like you can on a dashboard, for instance. We’ll then put all our newfound skills into practice by building a live sample app.

Our sample app is an animal gallery that we’ll use to view some pictures of different types of animals after we click the animal’s name on the navigation bar.

Installation

Let’s get right into the code. To create a React app, make sure you have Node.js installed on your computer. If you haven’t built a React app before, you can check to see if you have Node.js installed by typing the following into your terminal:

node -v

If not, just go to the Node.js website to download the latest version.

Once that’s done, we can get started with our React app by running this command:

npx create-react-app nav-bar                                             

Then, we navigate into our project folder on the terminal:

cd nav-bar

Setting up the React Router library

Using the React Router library in our application allows us to navigate between different pages or components in React, and actually makes these changes to the URL of each page or component. In fact, it can also handle more complex functionalities, like passing data between pages through queries and nested routes — but that’s beyond the scope of this article.

For this example, we’ll only need to install the React Router library to help us switch views of the animals in our app when we click on the nav names on the links.

npm install react-router-dom

Check out the tutorial for complete project.

Resources:

Code Sandbox: https://codesandbox.io/

Level 1(Previous Tutorial): https://youtu.be/23BHwAFIZmk

Source Code1: https://www.buymeacoffee.com/tech2etc/e/85299

Source Code2: https://ko-fi.com/s/7f02c9c3fd

Template & Setup(VS Code): https://github.com/tech2etc/React_Navbar_2

 

#react-native #react #nestjs #dom #htmlcss #web-development #dev 

React Navbar Tutorial - Responsive Navbar React JS
Nat  Grady

Nat Grady

1660712880

Roxygen2: Generate R Package Documentation From inline R Comments

roxygen2  

The premise of roxygen2 is simple: describe your functions in comments next to their definitions and roxygen2 will process your source code and comments to automatically generate .Rd files in man/, NAMESPACE, and, if needed, the Collate field in DESCRIPTION.

Installation

# Install devtools from CRAN
install.packages("roxygen2")

# Or the development version from GitHub:
# install.packages("devtools")
devtools::install_github("r-lib/roxygen2")

Usage

The premise of roxygen2 is simple: describe your functions in comments next to their definitions and roxygen2 will process your source code and comments to produce Rd files in the man/ directory. Here's a simple example from the stringr package:

#' The length of a string
#'
#' Technically this returns the number of "code points", in a string. One
#' code point usually corresponds to one character, but not always. For example,
#' an u with a umlaut might be represented as a single character or as the
#' combination a u and an umlaut.
#'
#' @inheritParams str_detect
#' @return A numeric vector giving number of characters (code points) in each
#'    element of the character vector. Missing string have missing length.
#' @seealso [stringi::stri_length()] which this function wraps.
#' @export
#' @examples
#' str_length(letters)
#' str_length(NA)
#' str_length(factor("abc"))
#' str_length(c("i", "like", "programming", NA))
str_length <- function(string) {
}

When you roxygenise() (or devtools::document()) your package these comments will be automatically transformed to the .Rd that R uses to generate the documentation you see when you type ?str_length.

Learn more

To get started, first read vignette("roxygen2"). Then read more about the specific package component that you want to generate:

Start with vignette("rd") to learn how document your functions with roxygen2.

vignette("rd-other") discusses how to document other things like datasets, the package itself, and the various pieces used by R's OOP systems.

vignette("rd-formatting") gives the details of roxygen2's rmarkdown support.

vignette("reuse") demonstrates the tools available to reuse documentation in multiple places.

vignette("namespace") describes how to generate a NAMESPACE file, how namespacing works in R, and how you can use roxygen2 to be specific about what your package needs and supplies.

For the Collate field in the DESCRIPTION, see ?update_collate().

Download Details:

Author: r-lib
Source Code: https://github.com/r-lib/roxygen2 
License: Unknown, MIT licenses found

#r #documentation #dev #tools 

Roxygen2: Generate R Package Documentation From inline R Comments
Nat  Grady

Nat Grady

1660701360

Devtools: Tools To Make an R Developer's Life Easier

devtools   

The aim of devtools is to make package development easier by providing R functions that simplify and expedite common tasks. R Packages is a book based around this workflow.

Installation

# Install devtools from CRAN
install.packages("devtools")

# Or the development version from GitHub:
# install.packages("devtools")
devtools::install_github("r-lib/devtools")

Cheatsheet

Usage

All devtools functions accept a path as an argument, e.g. load_all("path/to/mypkg"). If you don't specify a path, devtools will look in the current working directory - this is a recommended practice.

Frequent development tasks:

load_all() simulates installing and reloading your package, loading R code in R/, compiled shared objects in src/ and data files in data/. During development you would usually want to access all functions (even un-exported internal ones) so load_all() works as if all functions were exported in the package NAMESPACE.

document() updates generated documentation in man/, file collation and NAMESPACE.

test() reloads your code with load_all(), then runs all testthat tests.

test_coverage() runs test coverage on your package with covr. This makes it easy to see what parts of your package could use more tests!

Building and installing:

install() reinstalls the package, detaches the currently loaded version then reloads the new version with library(). Reloading a package is not guaranteed to work: see the documentation for unload() for caveats.

build() builds a package file from package sources. You can use it to build a binary version of your package.

install_* functions install an R package:

  • install_github() from GitHub
  • install_gitlab() from GitLab
  • install_bitbucket() from Bitbucket
  • install_url() from an arbitrary url
  • install_git() and install_svn() from an arbitrary git or SVN repository
  • install_local() from a local file on disk
  • install_version() from a specific version on CRAN

update_packages() updates a package to the latest version. This works both on packages installed from CRAN as well as those installed from any of the install_* functions.

Check and release:

check() updates the documentation, then builds and checks the package locally. check_win() checks a package using win-builder, and check_rhub() checks a package using r-hub. This allows you to easily check your package on all systems CRAN uses before submission.

release() makes sure everything is ok with your package (including asking you a number of questions), then builds and uploads to CRAN.

Learning more

R package development can be intimidating, however there are now a number of valuable resources to help!

R Packages is a book that gives a comprehensive treatment of all common parts of package development and uses devtools throughout.

  • The first edition is available at https://r-pkgs.org/, but note that it has grown somewhat out of sync with the current version of devtools.
  • A second edition is under development and is evolving to reflect the current state of devtools. It is available at https://r-pkgs.org.
  • The Whole Game and Package structure chapters make great places to start.

RStudio community - package development is a great place to ask specific questions related to package development.

rOpenSci packages has extensive documentation on best practices for R packages looking to be contributed to rOpenSci, but also very useful general recommendations for package authors.

There are a number of fantastic blog posts on writing your first package, including

Writing R Extensions is the exhaustive, canonical reference for writing R packages, maintained by the R core developers.

Conscious uncoupling

devtools started off as a lean-and-mean package to facilitate local package development, but over the years it accumulated more and more functionality. devtools has undergone a conscious uncoupling to split out functionality into smaller, more tightly focussed packages. This includes:

testthat: Writing and running tests (i.e. test()).

roxygen2: Function and package documentation (i.e. document()).

remotes: Installing packages (i.e. install_github()).

pkgbuild: Building binary packages (including checking if build tools are available) (i.e. build()).

pkgload: Simulating package loading (i.e. load_all()).

rcmdcheck: Running R CMD check and reporting the results (i.e. check()).

revdepcheck: Running R CMD check on all reverse dependencies, and figuring out what's changed since the last CRAN release (i.e. revdep_check()).

sessioninfo: R session info (i.e. session_info()).

usethis: Automating package setup (i.e. use_test()).

Generally, you would not need to worry about these different packages, because devtools installs all of them automatically. You will need to care, however, if you're filing a bug because reporting it at the correct place will lead to a speedier resolution.

You may also need to care if you are trying to use some devtools functionality in your own package or deployed application. Generally in these cases it is better to depend on the particular package directly rather than depend on devtools, e.g. use sessioninfo::session_info() rather than devtools::session_info(), or remotes::install_github() vs devtools::install_github().

However for day to day development we recommend you continue to use library(devtools) to quickly load all needed development tools, just like library(tidyverse) quickly loads all the tools necessary for data exploration and visualization.

Code of conduct

Please note that the devtools project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

Download Details:

Author: r-lib
Source Code: https://github.com/r-lib/devtools 
License: Unknown, MIT licenses found

#r #dev #tools 

Devtools: Tools To Make an R Developer's Life Easier
Ruthie  Blanda

Ruthie Blanda

1660215840

Ethereum's Missing P2p NFT and token Swap Library for Web3 Developers

NFT Swap Banner

Swap SDK

The missing peer-to-peer swap library for Ethereum and EVM-compatible chains, powered by the 0x protocol, written in TypeScript for web3 developers. Trade tokens (ERC20s), NFTs, and other collectibles (ERC721 and ERC1155) with just a few lines of code. Seriously, easily trade anything on Ethereum with this library.

🎉 Update 1/31/22: Swap SDK now supports 0x v4, check out the docs. 🎉

Overview

tl;dr: NFT Swap SDK is the easiest, most-powerful swap library available on the EVM. Supports Ethereum and EVM-compatible chains (Polygon, Avalanche, BSC, etc.). Works in both browser and Node.js. Written in TypeScript, built using the 0x protocol. With this library, you can build support for NFT marketplaces, over-the-counter (OTC) exchanges, and/or peer-to-peer exchanges.

The NFT Swap SDK developed by Trader.xyz offers swap support for ERC20s, ERC721s, and ERC1155s. Exchange NFTs for NFTs, NFTs for ERC20 tokens, or bundles of NFTs and tokens. This library provides the ultimate swap flexibility combined with a simple API surface area so you can be productive immediately and focus on building your web3 app.

This library is powered and secured by the 0x v3 protocol. The 0x v3 protocol has been in production for multiple years securing billions of dollars with of trades.

Goals

We want to share all underlying technology trader.xyz uses with the community. While we won't be open-sourcing our frontend, as we think design and UX is our differentiator, we believe in open-sourcing and freely sharing all underlying technology.

Our end goal is every piece of tech you see trader.xyz use (protocol, swap libraries, open-source orderbook, order monitor, high-performance NFT indexer, property-based orders, specific React hooks, and NFT aggregation) end up open-source. This library is the first step to achieving our goal.

Installation

You can install the SDK with yarn:

yarn add @traderxyz/nft-swap-sdk

or npm:

npm install @traderxyz/nft-swap-sdk

Configuration

To use the SDK, create a new NftSwap instance.

import { NftSwap } from '@traderxyz/nft-swap-sdk';

// From your app, provide NftSwap the web3 provider, signer for the user's wallet, and the chain id.
const nftSwapSdk = new NftSwap(provider, signer, chainId);

Now you're set up and ready to use the SDK in your program. Check out the examples below to learn how to swap with the library.

Examples

Example 1: NFT <> NFT swap

In this first example, we're going to do a 1:1 NFT swap. We're going to swap User A's CryptoPunk NFT for User B's Bored Ape NFT.

Terminology: maker: Since User A will initiate the trade, we'll refer to User A as the maker of the trade.

Terminology: taker: Since User B will be filling and completing the trade created by User A, we'll refer to User B as the taker of the trade.

// Setup the sample data...
const CHAIN_ID = 1; // Chain 1 corresponds to Mainnet. Visit https://chainid.network/ for a complete list of chain ids

const CRYPTOPUNK_420 = {
  tokenAddress: '0xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb', // CryptoPunk contract address
  tokenId: '420', // Token Id of the CryptoPunk we want to swap
  type: 'ERC721', // Must be one of 'ERC20', 'ERC721', or 'ERC1155'
};

const BORED_APE_69 = {
  tokenAddress: '0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D', // BAYC contract address
  tokenId: '69', // Token Id of the BoredApe we want to swap
  type: 'ERC721',
};

// User A Trade Data
const walletAddressUserA = '0x1eeD19957E0a81AED9a80f09a3CCEaD83Ea6D86b';
const assetsToSwapUserA = [CRYPTOPUNK_420];

// User B Trade Data
const walletAddressUserB = '0x44beA2b43600eE240AB6Cb90696048CeF32aBf1D';
const assetsToSwapUserB = [BORED_APE_69];

// ............................
// Part 1 of the trade -- User A (the 'maker') initiates an order
// ............................

// Initiate the SDK for User A.
// Pass the user's wallet signer (available via the user's wallet provider) to the Swap SDK
const nftSwapSdk = new NftSwap(provider, signerUserA, CHAIN_ID);

// Check if we need to approve the NFT for swapping
const approvalStatusForUserA = await nftSwapSdk.loadApprovalStatus(
  assetsToSwapUserA[0],
  walletAddressUserA
);
// If we do need to approve User A's CryptoPunk for swapping, let's do that now
if (!approvalStatusForUserA.contractApproved) {
  const approvalTx = await nftSwapSdk.approveTokenOrNftByAsset(
    assetsToSwapUserA[0],
    makerAddress
  );
  const approvalTxReceipt = await approvalTx.wait();
  console.log(
    `Approved ${assetsToSwapUserA[0].tokenAddress} contract to swap with 0x (txHash: ${approvalTxReceipt.transactionHash})`
  );
}

// Create the order (Remember, User A initiates the trade, so User A creates the order)
const order = nftSwapSdk.buildOrder(
  assetsToSwapUserA,
  assetsToSwapUserB,
  walletAddressUserA
);
// Sign the order (User A signs since they are initiating the trade)
const signedOrder = await nftSwapSdk.signOrder(order, makerAddress);
// Part 1 Complete. User A is now done. Now we send the `signedOrder` to User B to complete the trade.

// ............................
// Part 2 of the trade -- User B (the 'taker') accepts and fills order from User A and completes trade
// ............................
// Initiate the SDK for User B.
const nftSwapSdk = new NftSwap(provider, signerUserB, CHAIN_ID);

// Check if we need to approve the NFT for swapping
const approvalStatusForUserB = await nftSwapSdk.loadApprovalStatus(
  assetsToSwapUserB[0],
  walletAddressUserB
);
// If we do need to approve NFT for swapping, let's do that now
if (!approvalStatusForUserB.contractApproved) {
  const approvalTx = await nftSwapSdk.approveTokenOrNftByAsset(
    assetsToSwapUserB[0],
    walletAddressUserB
  );
  const approvalTxReceipt = await approvalTx.wait();
  console.log(
    `Approved ${assetsToSwapUserB[0].tokenAddress} contract to swap with 0x. TxHash: ${approvalTxReceipt.transactionHash})`
  );
}
// The final step is the taker (User B) submitting the order.
// The taker approves the trade transaction and it will be submitted on the blockchain for settlement.
// Once the transaction is confirmed, the trade will be settled and cannot be reversed.
const fillTx = await nftSwapSdk.fillSignedOrder(signedOrder);
const fillTxReceipt = await nftSwapSdk.awaitTransactionHash(fillTx.hash);
console.log(`🎉 🥳 Order filled. TxHash: ${fillTxReceipt.transactionHash}`);

Example 2: Swap bundles -- Bundle of mixed ERC721s and ERC20 <> Bundle of ERC20s

Here we show an example of what the swap library is capable of. We can even swap arbitrary ERC tokens in bundles. We call it a bundle when we have more than one item that a party will swap. Bundles can have different ERC types within the same bundle.

In other words, we can swap [ERC721, ERC1155, ERC20] <> [ERC721, ERC1155, ERC20]. There's really no limit to what we can swap.

More concrete example: We can swap [2 CryptoPunks and 1,000 DAI] for [420 WETH and 694,200 USDC]. In this case we'd be swapping two ERC721s and an ERC20 (Punk NFT and DAI, respectively) for two ERC20s (WETH and USDC).

This is just one example. In reality, you can swap as many things as you'd like, any way you'd like. The underlying 0x protocol is extremely flexible, and the NFT swap library abstracts all the complexity away so you don't have to worry about protocol nuances.

// Set up the sample data for the swap...
const CHAIN_ID = 1; // Mainnet

const CRYPTOPUNK_420 = {
  tokenAddress: '0xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb',
  tokenId: '420',
  type: 'ERC721',
};

const CRYPTOPUNK_421 = {
  tokenAddress: '0xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb',
  tokenId: '421',
  type: 'ERC721',
};

const ONE_THOUSAND_DAI = {
  tokenAddress: '0x6b175474e89094c44da98b954eedeac495271d0f', // DAI contract address
  amount: '1000000000000000000000', // 1,000 DAI (DAI is 18 digits) -- amount to swap
  type: 'ERC20',
};

const SIXTY_NINE_USDC = {
  tokenAddress: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', // USDC contract address
  amount: '69000000', // 69 USDC (USDC is 6 digits)
  type: 'ERC20',
};

const FOUR_THOUSAND_TWENTY_WETH = {
  tokenAddress: '0x6b175474e89094c44da98b954eedeac495271d0f', // WETH contract address
  amount: '420000000000000000000', // 420 Wrapped-ETH (WETH is 18 digits)
  type: 'ERC20',
};

// User A Trade Data
const walletAddressUserA = '0x1eeD19957E0a81AED9a80f09a3CCEaD83Ea6D86b';
const assetsToSwapUserA = [CRYPTOPUNK_420, CRYPTOPUNK_421, ONE_THOUSAND_DAI];

// User B Trade Data
const walletAddressUserB = '0x44beA2b43600eE240AB6Cb90696048CeF32aBf1D';
const assetsToSwapUserB = [SIXTY_NINE_USDC, FOUR_THOUSAND_TWENTY_WETH];

// ............................
// Part 1 of the trade -- User A (the 'maker') initiates an order
// ............................
const nftSwapSdk = new NftSwap(provider, signerUserA, CHAIN_ID);
// Note: For brevity, we assume all assets are approved for swap in this example.
// See previous example on how to approve an asset.

const order = nftSwapSdk.buildOrder(
  assetsToSwapUserA,
  assetsToSwapUserB,
  walletAddressUserA
);
const signedOrder = await nftSwapSdk.signOrder(order, makerAddress);

// ............................
// Part 2 of the trade -- User B (the 'taker') accepts and fills order from User A and completes trade
// ............................
const nftSwapSdk = new NftSwap(provider, signerUserB, CHAIN_ID);

const fillTx = await nftSwapSdk.fillSignedOrder(signedOrder);
const fillTxReceipt = await nftSwapSdk.awaitTransactionHash(fillTx);
console.log(`🎉 🥳 Order filled. TxHash: ${fillTxReceipt.transactionHash}`);

// Not so bad, right? We can arbitrarily add more assets to our swap without introducing additional complexity!

Example 3: React Hooks + Swap SDK

In this example, we'll leverage the amazing web3-react React Hook library.

const App = () => {
  const { library, chainId } = useWeb3React<Web3React>();

  const [swapSdk, setSwapSdk] = useState(null);
  useEffect(() => {
    const sdk = new NftSwap(library, library.getSigner(), chainId);
    setSwapSdk(sdk);
  }, [library, chainId])

  // Use the SDK however you'd like in the app...
  const handleClick = useCallback(() => {
    if (!swapSdk) {
      return;
    }
    swapSdk.buildOrder(...)
  }, [swapSdk])

  // ...
}

FAQ

Which ERCs does this library support?

  • ERC20, ERC721, and ERC1155

What EVM chains are currently supported?

  • Mainnet (1)
  • Kovan (42)
  • Rinkeby (4)
  • Polygon (137)
  • Binance Smart Chain (56)
  • Avalanche (43114)

What protocol does this library use?

  • trader.xyz and trader.xyz libraries are powered by 0x v3 Protocol. This protocol is mature and lindy, and has been extremely well-audited.
  • Check out the 0x v3 spec here
  • Check out the 0x v3 Consensys audit here

Are there any protocol fees to execute swaps?

  • No

How do I get the user's signer object?

  • Generally you can get it from the user's web3 wallet provider, by something like this: provider.getSigner().
  • See this ethers guide (control-f for getSigner).
  • In web3-react you can do:
    • const { library } = useWeb3React();
    • const signer = library.getSigner();

How do I store a SignedOrder

  • That's up to you. This library has no opinions on how to store orders. You can throw them in a centralized SQL database, save them to localstorage, use a decentralized messaging solution -- it's really up to you and your app concerns. You can even serialize and compress an order to fit in a tweet or shareable URL! 🤯

Support

For personalized help, please join the #dev-help channel in our Discord: https://discord.gg/2kAbrHs7 OR our Slack channel: https://join.slack.com/t/bcto-workspace/shared_invite/zt-18je7lax0-VSsTFeMh_PH3VnKeIr3QkA

For general documentation, check out https://docs.swapsdk.xyz

Roadmap

We're currently working on the following features for the next iteration of this library:

  • ✅ LIVE -- Persistent data store of orders (off-the-shelf storage in trader.xyz's public order storage server). Think of it as a public good
  • ✅ LIVE -- Property-based orders
  • ✅ LIVE -- Order validation
  • ✅ LIVE -- Live order status
  • Order event streaming via WebSockets

If you have feature requests, reach out in our Discord. OR our Slack: https://join.slack.com/t/bcto-workspace/shared_invite/zt-18je7lax0-VSsTFeMh_PH3VnKeIr3QkA

We want to make this library a one-stop shop for all your NFT swapping needs.


Author: serenesky0914
Source code: https://github.com/serenesky0914/nft-swap-sdk
License: MIT license

#react-native #typescript #nft #web3 #P2p 

Ethereum's Missing P2p NFT and token Swap Library for Web3 Developers
Alexis Gilbert

Alexis Gilbert

1660041252

Hire .Net Core Developer To get below .Net Core Development Services!

#aspdotnet #dotnetcore #programmer #dev 

Every product owner wants to take their web applications to the next level with the smoothest User experience and high-yielding results. However, in order to achieve that one needs to hire software developers from web development companies that can give ultimate justice to your web development requirements.

In the case of .Net Core Development Technology, there are numerous .net core Development Companies that offer profound .net core development services which give excellent .Net Core apps features and quality with less amount of effort from the .Net Core developers.

So let's see what kind of benefits you are going to get while hiring a professional .Net Core Developer for your project.

  1. End-to-end ASP.NET Assessment
  2. .NET core migration and upgradation
  3. Customized .Net Core consulting

In order to provide such services, it is advisable to double-check that your .NET Core Developer possesses certain qualities and tech excellence that will give justice to the top quality of your application.

Hire .Net Core Developer to utilize the magical elements of .NET core  libraries

Such qualities are as below,

  1. Integration of SSR
  2. Analyzing and Visualizing Data with Power BI
  3. Cross-platform app implementation
  4. Excellent in Version Control
  5. Legacy system modernization

So these qualities for tech excellence are just the starters while there could be many others that very well serve your project with a custom-made tailored approach.

Hire .Net Core Developer that really gets your aim and requirement and serves you and your project accordingly.