0.0.9 ā€¢ Published 2 years ago

@yak-spirit/yak-swap-ui v0.0.9

Weekly downloads
-
License
GPL-3.0-or-later
Repository
github
Last release
2 years ago

šŸƒ @yak-spirit/yak-swap-ui

License: GPL v3

A reusable React component for swapping with Yield Yak Router. The YY Router can be found here.

npm component

Usage example: Yak Spirit

Usage

You can use swap as iframe or as React component:

Iframe

Just insert this iframe

<iframe width="400" height="525" src="https://yak-swap-ui-example.vercel.app/"></iframe>

example https://codesandbox.io/s/xenodochial-shtern-neh7b?file=/index.html

React component

First install the required peer dependencies into your React project.

yarn add web3 bignumber.js react-use react-countdown-circle-timer valtio react-number-format @headlessui/react classnames react-windowed-select react-moralis moralis daisyui eth-permit react-toastify react-transition-group

Wrap your app in MoralisProvider, provide appId & serverId (server should support Avalanche Mainnet) You can find instructions here: https://github.com/MoralisWeb3/react-moralis

Install tailwind (use as guidance https://tailwindcss.com/docs/guides/create-react-app)

yarn add -D tailwindcss postcss autoprefixer
npx tailwindcss init -p

Configure tailwind.config.js (example configuration in yak-spirit repo) You need something like './node_modules/@yak-spirit/yak-swap-ui/**/*.js' in tailwind.config content array Add tailwind directives to your CSS and import .css file

And import toastify styles

import 'react-toastify/dist/ReactToastify.css';

āš ļø if you have webpack >= 5 or cra >= 5, you should do some manipulations to include node-compatible dependencies. Check examples.

Then install the package.

yarn add @dragoonzx/yak-swap-ui

Add the Swap Component

To embed the YakSwap component into your application, you should do all prerequisite installation and then you can just use component For example,

import YakSwap from '@yak-spirit/yak-swap-ui';

<YakSwap />;

All of the complexity of communicating with the YY Router and managing its data is handled internally by the component.

Referral Fees

To earn referral fees ...

Developing

Install dependencies

yarn

Build

yarn build

Run the example app

yarn dev

Contributing

Interested in contributing to the Yak Spirit or Yak Swap UI? Thanks so much for your interest! We are always looking for improvements to the project and contributions from open-source developers are greatly appreciated.

If you have a contribution in mind, please open issue or PR with your ideas.

Licence

Yak Spirit & Yak Swap UI is GNU-3 licensed

Base64acceptsacornacorn-jsxacorn-nodeacorn-walkaggregate-errorajvansi-colorsansi-escapesansi-regexansi-stylesanymatcharchargargparsearray-flattenarray-includesarray-unionarray.prototype.flatarray.prototype.flatmapasn1asn1.jsassert-plusassertion-errorastral-regexasyncasync-limiterasynckitat-least-nodeavailable-typed-arraysaws-sign2aws4axiosbalanced-matchbase-xbase64-jsbcrypt-pbkdfbinary-extensionsblakejsblob-utilbluebirdbn.jsbody-parserbrace-expansionbracesbrorandbrowserify-aesbrowserify-cipherbrowserify-desbrowserify-rsabrowserify-signbrowserslistbs58bs58checkbufferbuffer-crc32buffer-to-arraybufferbuffer-xorbufferutilbuiltinsbytescacheable-requestcachedircall-bindcallsitescamelcase-csscaniuse-litecaselesschaichalkcheck-errorcheck-more-typeschokidarchownrci-infocidscipher-baseclass-isclean-stackcli-cursorcli-table3cli-truncateclone-responseclsxcolorcolor-convertcolor-namecolor-stringcolorettecolorscombined-streamcommandercommon-tagsconcat-mapcontent-dispositioncontent-hashcontent-typeconvert-source-mapcookiecookie-signaturecookiejarcopy-to-clipboardcore-js-purecore-util-iscorscosmiconfigcrc-32create-ecdhcreate-hashcreate-hmaccross-spawncrypto-browserifycrypto-jscss-color-namescss-in-js-utilscss-treecss-unit-convertercssesccsstypeddashdashdayjsdebugdecode-uri-componentdecompress-responsedeep-eqldeep-isdefer-to-connectdefine-propertiesdefineddelayed-streamdepddes.jsdestroydetectivedidyoumeandiffie-hellmandir-globdlvdoctrinedom-helpersdom-walkduplexer3ecc-jsbnee-firstelectron-to-chromiumellipticemoji-regexencodeurlend-of-streamenquirererror-exerror-stack-parseres-abstractes-to-primitivees5-extes6-iteratores6-symbolesbuildescaladeescape-htmlescape-string-regexpeslint-import-resolver-nodeeslint-module-utilseslint-plugin-eseslint-scopeeslint-utilseslint-visitor-keysespreeesprimaesqueryesrecurseestraverseestree-walkeresutilsetageth-ens-namehasheth-libeth-permitethereum-bloom-filtersethereum-cryptographyethereumjs-utilethjs-uniteventemitter2eventemitter3evp_bytestokeyexecaexecutableexit-on-epipeexpressextextendextract-zipextsprintffast-deep-equalfast-globfast-json-stable-stringifyfast-levenshteinfast-shallow-equalfastest-stable-stringifyfastqfd-slicerfiguresfile-entry-cachefill-rangefinalhandlerfind-upflat-cacheflattedfollow-redirectsforeachforever-agentform-dataforwardedfraction.jsfreshfs-extrafs-minipassfs.realpathfunction-bindfunctional-red-black-treegensyncget-func-nameget-intrinsicget-own-enumerable-property-symbolsget-streamget-symbol-descriptiongetosgetpassglobglob-parentglob-regexglobalglobal-dirsglobalsglobbyglobrexgotgraceful-fshar-schemahar-validatorhashas-bigintshas-flaghas-symbol-support-xhas-symbolshas-to-string-tag-xhas-tostringtaghash-basehash.jshex-color-regexhistoryhmac-drbghoist-non-react-staticshsl-regexhsla-regexhtml-escaperhtml-parse-stringifyhtml-tagshttp-cache-semanticshttp-errorshttp-httpshttp-signaturehuman-signalshyphenate-style-nameiconv-liteidna-uts46-hxieee754ignoreimmerimport-cwdimport-freshimport-fromimport-meta-resolveimurmurhashindent-stringinflightinheritsiniinline-style-prefixerinternal-slotinvariantipaddr.jsis-argumentsis-arrayishis-bigintis-binary-pathis-boolean-objectis-callableis-ciis-color-stopis-core-moduleis-date-objectis-extglobis-fullwidth-code-pointis-functionis-generator-functionis-globis-hex-prefixedis-installed-globallyis-negative-zerois-numberis-number-objectis-objis-objectis-path-insideis-plain-objis-regexis-regexpis-retry-allowedis-shared-array-bufferis-streamis-stringis-symbolis-typed-arrayis-typedarrayis-unicode-supportedis-weakrefisarrayisexeisobjectisstreamisurljs-cookiejs-sha3js-tokensjs-yamljsbnjsescjson-bufferjson-parse-even-better-errorsjson-schemajson-schema-traversejson-stable-stringify-without-jsonifyjson-stringify-safejson5jsonfilejsprimjsx-ast-utilskeccakkeyvlazy-asslevnlilconfiglines-and-columnslint-stagedlistr2local-pkglocate-pathlodashlodash.mergelodash.oncelodash.topathlodash.truncatelog-symbolslog-updateloose-envifylowercase-keyslru-cachemd5.jsmdn-datamedia-typermemoize-onemerge-descriptorsmerge-streammerge2methodsmicromatchmiller-rabinmimemime-dbmime-typesmimic-fnmimic-responsemin-documentmini-create-react-contextminimalistic-assertminimalistic-crypto-utilsminimatchminimistminipassminizlibmkdirpmkdirp-promisemllymock-fsmodern-normalizemsmultibasemulticodecmultihashesnano-cssnano-json-stream-parsernanoidnatural-comparenegotiatornext-ticknode-addon-apinode-emojinode-gyp-buildnode-releasesnormalize-pathnormalize-rangenormalize-urlnpm-run-pathnumber-to-bnoauth-signobject-assignobject-hashobject-inspectobject-keysobject.assignobject.entriesobject.fromentriesobject.hasownobject.valuesoboeon-finishedonceonetimeoptionatorospathp-cancelablep-finallyp-limitp-locatep-mapp-timeoutp-trypakoparent-moduleparse-asn1parse-headersparse-jsonparseurlpath-existspath-is-absolutepath-keypath-parsepath-to-regexppath-typepathvalpbkdf2pendperformance-nowpicocolorspicomatchpifypkg-dirplease-upgrade-nodepostcss-jspostcss-load-configpostcss-nestedpostcss-selector-parserpostcss-value-parserprelude-lsprepend-httppretty-bytespretty-hrtimeprintjprogressprop-typesproxy-addrproxy-compareproxy-from-envpslpublic-encryptpumppunycodepurgecssqsquery-stringquerystringqueue-microtaskquick-lrurandombytesrandomfillrange-parserraw-bodyreact-fast-comparereact-input-autosizereact-isreact-native-crypto-jsreact-refreshreact-routerreact-selectreact-transition-groupreact-universal-interfacereact-windowreadable-streamreaddirprecrawl-syncreduce-css-calcregenerator-runtimeregexp.prototype.flagsregexpprequestrequest-progressrequire-from-stringresize-observer-polyfillresolveresolve-fromresolve-pathnameresponselikerestore-cursorreusifyrfdcrgb-regexrgba-regexrimrafripemd160rlprolluprtl-css-jsrun-parallelrxjssafe-buffersafer-bufferschedulerscreenfullscrypt-jssecp256k1semversemver-comparesendserve-staticservifyset-harmonic-intervalsetimmediatesetprototypeofsha.jsshallowequalshebang-commandshebang-regexside-channelsignal-exitsimple-concatsimple-getsimple-swizzleslashslice-ansisource-mapsource-map-jssourcemap-codecsprintf-jssshpkstack-generatorstackframestacktrace-gpsstacktrace-jsstatusesstrict-uri-encodestring-argvstring-widthstring.prototype.matchallstring.prototype.trimendstring.prototype.trimstartstring_decoderstringify-objectstrip-ansistrip-bomstrip-final-newlinestrip-hex-prefixstrip-json-commentsstylissupports-colorswarm-jstabletartext-tablethrottle-debouncethrottleitthroughtimed-outtiny-invarianttiny-warningtinypooltinyspytmpto-fast-propertiesto-readable-streamto-regex-rangetoggle-selectiontoidentifiertough-cookiets-easingtsconfig-pathstslibtsutilstunnel-agenttweetnacltypetype-checktype-detecttype-festtype-istypedarray-to-bufferultronunbox-primitiveuniversalifyunpipeuntildifyuri-jsurlurl-parse-laxurl-set-queryurl-to-optionsuse-elapsed-timeuse-immerutf-8-validateutf8util-deprecateutils-mergeuuidv8-compile-cachevalue-equalvarintvaryverrorvoid-elementsweb3-bzzweb3-coreweb3-core-helpersweb3-core-methodweb3-core-promieventweb3-core-requestmanagerweb3-core-subscriptionsweb3-ethweb3-eth-abiweb3-eth-accountsweb3-eth-contractweb3-eth-ensweb3-eth-ibanweb3-eth-personalweb3-netweb3-providers-httpweb3-providers-ipcweb3-providers-wsweb3-shhweb3-utilswebsocketwhichwhich-boxed-primitivewhich-typed-arrayword-wrapwrap-ansiwrappywsxhrxhr-requestxhr-request-promisexhr2-cookiesxmlhttprequestxtendyaetiyallistyamlyauzl
0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago