Skip to content

Offramp prototype - Phase 2#18

Merged
gianfra-t merged 40 commits into
offramp-prototype-stagingfrom
spacewalk-mykobo-prototype
Apr 26, 2024
Merged

Offramp prototype - Phase 2#18
gianfra-t merged 40 commits into
offramp-prototype-stagingfrom
spacewalk-mykobo-prototype

Conversation

@gianfra-t
Copy link
Copy Markdown
Contributor

@gianfra-t gianfra-t commented Apr 15, 2024

Possible improvements

Although this is a prototype, there are some checks and improvements that could be improved on a more refined system.

  • Check that the input secret (or connected wallet in the future) has enough EURC in Pendulum required for the minimum amount of off-ramping, which at the moment is 10 EUR.
    This check is quite simple to add and would save the user time and confusion.
  • Ability for the process to resume after some interruption. Right now, the entire process runs on the browser. If the user closes the browser the operation could stop at a critical moment where funds could be stuck on the ephemeral account, or in the process to be redeemed to it.
    We could improve this by using cookies such that upon reloading of the page, an existing operation could resume. Careful consideration must be done into what secrets are stored on the local storage.

Closes #19

@gianfra-t gianfra-t changed the title Spacewalk mykobo prototype [Draft] Spacewalk mykobo prototype Apr 15, 2024
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 15, 2024

yarn.lock changes

Summary

Status Count
ADDED 286
UPDATED 64
DOWNGRADED 1
Click to toggle table visibility
Name Status Previous Current
@chainsafe/metamask-polkadot-adapter ADDED - 0.6.0
@chainsafe/metamask-polkadot-types ADDED - 0.7.0
@lit-labs/ssr-dom-shim ADDED - 1.2.0
@lit/reactive-element ADDED - 1.6.3
@motionone/animation ADDED - 10.17.0
@motionone/dom ADDED - 10.17.0
@motionone/easing ADDED - 10.17.0
@motionone/generators ADDED - 10.17.0
@motionone/svelte ADDED - 10.16.4
@motionone/types ADDED - 10.17.0
@motionone/utils ADDED - 10.17.0
@motionone/vue ADDED - 10.16.4
@noble/curves UPDATED 1.0.0 1.4.0
@noble/hashes UPDATED 1.3.0 1.4.0
@parcel/watcher ADDED - 2.4.1
@parcel/watcher-android-arm64 ADDED - 2.4.1
@parcel/watcher-darwin-arm64 ADDED - 2.4.1
@parcel/watcher-darwin-x64 ADDED - 2.4.1
@parcel/watcher-freebsd-x64 ADDED - 2.4.1
@parcel/watcher-linux-arm-glibc ADDED - 2.4.1
@parcel/watcher-linux-arm64-glibc ADDED - 2.4.1
@parcel/watcher-linux-arm64-musl ADDED - 2.4.1
@parcel/watcher-linux-x64-glibc ADDED - 2.4.1
@parcel/watcher-linux-x64-musl ADDED - 2.4.1
@parcel/watcher-wasm ADDED - 2.4.1
@parcel/watcher-win32-arm64 ADDED - 2.4.1
@parcel/watcher-win32-ia32 ADDED - 2.4.1
@parcel/watcher-win32-x64 ADDED - 2.4.1
@polkadot-api/client ADDED - 0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0
@polkadot-api/json-rpc-provider ADDED - 0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0
@polkadot-api/json-rpc-provider-proxy ADDED - 0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0
@polkadot-api/metadata-builders ADDED - 0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0
@polkadot-api/substrate-bindings ADDED - 0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0
@polkadot-api/substrate-client ADDED - 0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0
@polkadot-api/utils ADDED - 0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0
@polkadot/api UPDATED 10.6.1 10.13.1
@polkadot/api-augment UPDATED 10.6.1 10.13.1
@polkadot/api-base UPDATED 10.6.1 10.13.1
@polkadot/api-derive UPDATED 10.6.1 10.13.1
@polkadot/extension-dapp ADDED - 0.47.1
@polkadot/extension-inject ADDED - 0.47.1
@polkadot/keyring UPDATED 12.1.2 12.6.2
@polkadot/networks UPDATED 12.1.2 12.6.2
@polkadot/rpc-augment UPDATED 10.6.1 10.13.1
@polkadot/rpc-core UPDATED 10.6.1 10.13.1
@polkadot/rpc-provider UPDATED 10.6.1 10.13.1
@polkadot/types UPDATED 10.6.1 10.13.1
@polkadot/types-augment UPDATED 10.6.1 10.13.1
@polkadot/types-codec UPDATED 10.6.1 10.13.1
@polkadot/types-create UPDATED 10.6.1 10.13.1
@polkadot/types-known UPDATED 10.6.1 10.13.1
@polkadot/types-support UPDATED 10.6.1 10.13.1
@polkadot/util UPDATED 12.1.2 12.6.2
@polkadot/util-crypto UPDATED 12.1.2 12.6.2
@polkadot/wasm-bridge UPDATED 7.1.2 7.3.2
@polkadot/wasm-crypto UPDATED 7.1.2 7.3.2
@polkadot/wasm-crypto-asmjs UPDATED 7.1.2 7.3.2
@polkadot/wasm-crypto-init UPDATED 7.1.2 7.3.2
@polkadot/wasm-crypto-wasm UPDATED 7.1.2 7.3.2
@polkadot/wasm-util UPDATED 7.1.2 7.3.2
@polkadot/x-bigint UPDATED 12.1.2 12.6.2
@polkadot/x-fetch UPDATED 12.1.2 12.6.2
@polkadot/x-global UPDATED 12.1.2 12.6.2
@polkadot/x-randomvalues UPDATED 12.1.2 12.6.2
@polkadot/x-textdecoder UPDATED 12.1.2 12.6.2
@polkadot/x-textencoder UPDATED 12.1.2 12.6.2
@polkadot/x-ws UPDATED 12.1.2 12.6.2
@scure/base UPDATED 1.1.1 1.1.6
@stablelib/aead ADDED - 1.0.1
@stablelib/binary ADDED - 1.0.1
@stablelib/bytes ADDED - 1.0.1
@stablelib/chacha ADDED - 1.0.1
@stablelib/chacha20poly1305 ADDED - 1.0.1
@stablelib/constant-time ADDED - 1.0.1
@stablelib/ed25519 ADDED - 1.0.3
@stablelib/hash ADDED - 1.0.1
@stablelib/hkdf ADDED - 1.0.1
@stablelib/hmac ADDED - 1.0.1
@stablelib/int ADDED - 1.0.1
@stablelib/keyagreement ADDED - 1.0.1
@stablelib/poly1305 ADDED - 1.0.1
@stablelib/random ADDED - 1.0.2
@stablelib/sha256 ADDED - 1.0.1
@stablelib/sha512 ADDED - 1.0.1
@stablelib/wipe ADDED - 1.0.1
@stablelib/x25519 ADDED - 1.0.3
@stellar/js-xdr ADDED - 3.1.1
@stellar/stellar-base ADDED - 11.0.1
@substrate/connect UPDATED 0.7.26 0.8.8
@substrate/connect-extension-protocol UPDATED 1.0.1 2.0.0
@substrate/connect-known-chains ADDED - 1.1.4
@substrate/light-client-extension-helpers ADDED - 0.0.4
@substrate/ss58-registry UPDATED 1.40.0 1.47.0
@talismn/connect-components ADDED - 1.1.8
@talismn/connect-ui ADDED - 1.1.3
@talismn/connect-wallets ADDED - 1.2.5
@tanstack/query-core ADDED - 5.31.0
@tanstack/react-query ADDED - 5.31.0
@testing-library/react ADDED - 13.4.0
@trysound/sax ADDED - 0.2.0
@types/big.js ADDED - 6.2.2
@types/bn.js UPDATED 5.1.1 5.1.5
@types/cssnano ADDED - 5.0.0
@types/react UPDATED 18.2.5 18.2.79
@types/react-dom ADDED - 18.2.25
@types/trusted-types ADDED - 2.0.7
@walletconnect/core ADDED - 2.12.2
@walletconnect/environment ADDED - 1.0.1
@walletconnect/events ADDED - 1.0.1
@walletconnect/heartbeat ADDED - 1.2.1
@walletconnect/jsonrpc-http-connection ADDED - 1.0.7
@walletconnect/jsonrpc-provider ADDED - 1.0.13
@walletconnect/jsonrpc-types ADDED - 1.0.3
@walletconnect/jsonrpc-utils ADDED - 1.0.8
@walletconnect/jsonrpc-ws-connection ADDED - 1.0.14
@walletconnect/keyvaluestorage ADDED - 1.1.1
@walletconnect/logger ADDED - 2.1.2
@walletconnect/modal ADDED - 2.6.2
@walletconnect/modal-core ADDED - 2.6.2
@walletconnect/modal-ui ADDED - 2.6.2
@walletconnect/relay-api ADDED - 1.0.10
@walletconnect/relay-auth ADDED - 1.0.4
@walletconnect/safe-json ADDED - 1.0.2
@walletconnect/sign-client ADDED - 2.12.2
@walletconnect/time ADDED - 1.0.2
@walletconnect/types ADDED - 2.12.2
@walletconnect/universal-provider ADDED - 2.12.2
@walletconnect/utils ADDED - 2.12.2
@walletconnect/window-getters ADDED - 1.0.1
@walletconnect/window-metadata ADDED - 1.0.1
acorn UPDATED 8.8.2 8.11.3
ansi-escapes UPDATED 6.2.0 6.2.1
atomic-sleep ADDED - 1.0.0
axios ADDED - 1.6.8
base32.js ADDED - 0.1.0
base64-js ADDED - 1.5.1
big.js ADDED - 6.2.1
bignumber.js ADDED - 9.1.2
binary-extensions ADDED - 2.3.0
boolbase ADDED - 1.0.0
buffer ADDED - 6.0.3
caniuse-api ADDED - 3.0.0
caniuse-lite UPDATED 1.0.30001482 1.0.30001612
chokidar ADDED - 3.6.0
citty ADDED - 0.1.6
clipboardy ADDED - 4.0.0
colord ADDED - 2.9.3
concat-with-sourcemaps ADDED - 1.1.0
confbox ADDED - 0.1.7
consola ADDED - 3.2.3
cookie-es ADDED - 1.1.0
cross-fetch ADDED - 3.1.8
crossws ADDED - 0.2.4
css-declaration-sorter ADDED - 6.4.1
css-select ADDED - 4.3.0
css-tree ADDED - 1.1.3
css-what ADDED - 6.1.0
cssesc ADDED - 3.0.0
cssnano ADDED - 5.1.15
cssnano-preset-default ADDED - 5.2.14
cssnano-utils ADDED - 3.1.0
csso ADDED - 4.2.0
decamelize ADDED - 1.2.0
decode-uri-component ADDED - 0.2.2
defu ADDED - 6.1.4
destr ADDED - 2.0.3
detect-browser ADDED - 5.3.0
detect-libc ADDED - 1.0.3
dijkstrajs ADDED - 1.0.3
dom-serializer ADDED - 1.4.1
domelementtype ADDED - 2.3.0
domhandler ADDED - 4.3.1
domutils ADDED - 2.8.0
duplexify ADDED - 4.1.3
electron-to-chromium UPDATED 1.4.382 1.4.745
encode-utf8 ADDED - 1.0.3
end-of-stream ADDED - 1.4.4
events ADDED - 3.3.0
eventsource ADDED - 2.0.2
fast-redact ADDED - 3.5.0
filter-obj ADDED - 1.1.0
follow-redirects ADDED - 1.15.6
fs-extra ADDED - 10.1.0
function-bind UPDATED 1.1.1 1.1.2
generic-names ADDED - 4.0.0
get-port-please ADDED - 3.1.2
h3 ADDED - 1.11.1
hasown ADDED - 2.0.2
hey-listen ADDED - 1.0.8
http-shutdown ADDED - 1.2.2
husky UPDATED 8.0.3 9.0.11
icss-replace-symbols ADDED - 1.1.0
icss-utils ADDED - 5.1.0
idb-keyval ADDED - 6.2.1
ieee754 ADDED - 1.2.1
import-cwd ADDED - 3.0.0
import-from ADDED - 3.0.0
iron-webcrypto ADDED - 1.1.1
is-binary-path ADDED - 2.1.0
is-core-module UPDATED 2.12.0 2.13.1
is-docker ADDED - 3.0.0
is-inside-container ADDED - 1.0.0
is-wsl ADDED - 3.1.0
is64bit ADDED - 2.0.0
isomorphic-unfetch ADDED - 3.1.0
jiti ADDED - 1.21.0
jsonfile ADDED - 6.1.0
keyvaluestorage-interface ADDED - 1.0.0
lint-staged UPDATED 15.2.0 15.2.2
listhen ADDED - 1.7.2
listr2 UPDATED 8.0.0 8.0.1
lit ADDED - 2.8.0
lit-element ADDED - 3.3.3
lit-html ADDED - 2.8.0
loader-utils ADDED - 3.2.1
lodash.camelcase ADDED - 4.3.0
lodash.isequal ADDED - 4.5.0
lodash.memoize ADDED - 4.1.2
lodash.uniq ADDED - 4.5.0
lru-cache UPDATED 10.0.1 10.2.0
mdn-data ADDED - 2.0.14
mime ADDED - 3.0.0
mlly ADDED - 1.6.1
mock-socket UPDATED 9.2.1 9.3.1
motion ADDED - 10.16.2
mri ADDED - 1.2.0
multiformats ADDED - 9.9.0
nanoid UPDATED 3.3.6 3.3.7
napi-wasm ADDED - 1.1.0
nock UPDATED 13.3.1 13.5.4
node-addon-api ADDED - 7.1.0
node-fetch UPDATED 3.3.1 3.3.2
node-fetch-native ADDED - 1.6.4
node-forge ADDED - 1.3.1
node-gyp-build UPDATED 4.6.0 4.8.0
node-releases UPDATED 2.0.10 2.0.14
normalize-url ADDED - 6.1.0
npm-run-path UPDATED 5.1.0 5.3.0
nth-check ADDED - 2.1.1
ofetch ADDED - 1.3.4
ohash ADDED - 1.1.3
on-exit-leak-free ADDED - 0.2.0
p-finally ADDED - 1.0.0
p-queue ADDED - 6.6.2
p-timeout ADDED - 3.2.0
pathe ADDED - 1.1.2
pify ADDED - 5.0.0
pino ADDED - 7.11.0
pino-abstract-transport ADDED - 0.5.0
pino-std-serializers ADDED - 4.0.0
pkg-types ADDED - 1.1.0
pngjs ADDED - 5.0.0
postcss UPDATED 8.4.23 8.4.38
postcss-calc ADDED - 8.2.4
postcss-colormin ADDED - 5.3.1
postcss-convert-values ADDED - 5.1.3
postcss-discard-comments ADDED - 5.1.2
postcss-discard-duplicates ADDED - 5.1.0
postcss-discard-empty ADDED - 5.1.1
postcss-discard-overridden ADDED - 5.1.0
postcss-load-config ADDED - 3.1.4
postcss-merge-longhand ADDED - 5.1.7
postcss-merge-rules ADDED - 5.1.4
postcss-minify-font-values ADDED - 5.1.0
postcss-minify-gradients ADDED - 5.1.1
postcss-minify-params ADDED - 5.1.4
postcss-minify-selectors ADDED - 5.2.1
postcss-modules ADDED - 6.0.0
postcss-modules-extract-imports ADDED - 3.1.0
postcss-modules-local-by-default ADDED - 4.0.5
postcss-modules-scope ADDED - 3.2.0
postcss-modules-values ADDED - 4.0.0
postcss-normalize-charset ADDED - 5.1.0
postcss-normalize-display-values ADDED - 5.1.0
postcss-normalize-positions ADDED - 5.1.1
postcss-normalize-repeat-style ADDED - 5.1.1
postcss-normalize-string ADDED - 5.1.0
postcss-normalize-timing-functions ADDED - 5.1.0
postcss-normalize-unicode ADDED - 5.1.1
postcss-normalize-url ADDED - 5.1.0
postcss-normalize-whitespace ADDED - 5.1.1
postcss-ordered-values ADDED - 5.1.3
postcss-reduce-initial ADDED - 5.1.2
postcss-reduce-transforms ADDED - 5.1.0
postcss-selector-parser ADDED - 6.0.16
postcss-svgo ADDED - 5.1.0
postcss-unique-selectors ADDED - 5.1.1
postcss-value-parser ADDED - 4.2.0
process-warning ADDED - 1.0.0
promise.series ADDED - 0.2.0
proxy-compare ADDED - 2.5.1
proxy-from-env ADDED - 1.1.0
qrcode ADDED - 1.5.3
query-string ADDED - 7.1.3
quick-format-unescaped ADDED - 4.0.4
radix3 ADDED - 1.1.2
randombytes ADDED - 2.1.0
react ADDED - 18.2.0
react-daisyui ADDED - 5.0.0
react-dom ADDED - 18.2.0
react-native-compat ADDED - 1.0.0
readdirp ADDED - 3.6.0
real-require ADDED - 0.1.0
require-main-filename ADDED - 2.0.0
reserved-words ADDED - 0.1.2
rfdc UPDATED 1.3.0 1.3.1
rollup-plugin-postcss ADDED - 4.0.2
rollup-plugin-postcss-modules ADDED - 2.1.1
rollup-plugin-styles ADDED - 4.0.0
safe-identifier ADDED - 0.4.2
safe-stable-stringify ADDED - 2.4.3
scale-ts ADDED - 1.6.0
scheduler ADDED - 0.23.0
sha.js ADDED - 2.4.11
smoldot UPDATED 1.0.4 2.0.22
sodium-native ADDED - 4.1.1
sonic-boom ADDED - 2.8.0
source-map-js UPDATED 1.0.2 1.2.0
split-on-first ADDED - 1.1.0
split2 ADDED - 4.2.0
stable ADDED - 0.1.8
std-env ADDED - 3.7.0
stellar-base ADDED - 11.0.1
stellar-sdk ADDED - 11.3.0
stream-shift ADDED - 1.0.3
strict-uri-encode ADDED - 2.0.0
string-hash ADDED - 1.1.3
string-width UPDATED 7.0.0 7.1.0
style-inject ADDED - 0.3.0
stylehacks ADDED - 5.1.1
svgo ADDED - 2.8.0
system-architecture ADDED - 0.1.0
thread-stream ADDED - 0.15.2
toml ADDED - 3.0.0
tslib UPDATED 2.5.0 2.6.2
type-fest DOWNGRADED 3.13.1 0.21.3
ufo ADDED - 1.5.3
uint8arrays ADDED - 3.1.1
uncrypto ADDED - 0.1.3
unenv ADDED - 1.9.0
unfetch ADDED - 4.2.0
universalify UPDATED 0.2.0 2.0.1
unstorage ADDED - 1.10.2
untun ADDED - 0.1.3
update-browserslist-db UPDATED 1.0.11 1.0.13
uqr ADDED - 0.1.2
urijs ADDED - 1.19.11
use-sync-external-store ADDED - 1.2.0
valtio ADDED - 1.11.2
which-module ADDED - 2.0.1
ws UPDATED 8.13.0 8.16.0

Copy link
Copy Markdown
Member

@ebma ebma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is already in a very good state, nice job @gianfra-t 👌
Would be nice to test the whole flow with the proper secrets or in a test environment but we have to clarify this on Slack.

Can you please run yarn lint and fix some of the errors? I'm fine if we ignore some of the warnings but some useEffect hooks are missing dependencies which can lead to bugs and eslint will point this out to you.

Comment thread vite.config.ts
@gianfra-t
Copy link
Copy Markdown
Contributor Author

@ebma regarding the linting issues, there are 2 that I decided to deactivate the warning for:

Here it was complaining about some variables not being listed as dependency of the hook. In this particular case I think we can either ignore it or refactor how the processes are started entirely, since the intention of this hook is to only trigger upon change of the state variable.

And here we have defined an async promise handler which seems to be also bad practice. Since that logic I have not tested but we know works from the other repos we have, I would say we first test it and then we can refactor that part.

@ebma
Copy link
Copy Markdown
Member

ebma commented Apr 16, 2024

I fixed those two issues as well. It's risky to ignore the useEffect dependency warning. In our case it could have happened that the hook would just call the respective functions with outdated secrets and we would spend a lot of time debugging mysterious bugs.

I think this solves #17. We should wait for someone to test the whole flow. And we should also not merge this branch for now and keep the changes on the extra branch.

@gianfra-t
Copy link
Copy Markdown
Contributor Author

@ebma I agree with the hook issue, but wouldn't the new refactor of the promise return as soon as the transaction is signed, and not wait for the actual event emitted? Previously we where passing the resolve handler to the callback. I am afraid this will return before the block is finalized and not showing the actual event.

@ebma
Copy link
Copy Markdown
Member

ebma commented Apr 17, 2024

Previously we where passing the resolve handler to the callback. I am afraid this will return before the block is finalized and not showing the actual event.

Ohh yes, thanks for double-checking that! I changed it again, please have another look 😅

Comment thread src/helpers/parseNumbers.ts Outdated
@TorstenStueber
Copy link
Copy Markdown
Contributor

TorstenStueber commented Apr 23, 2024

Same comment here, please change this PR to not merge into main but a special branch such as offramp-prototype (as specified in the original ticket). Let's leave main for the actual product.

@ebma ebma changed the base branch from main to offramp-prototype-staging April 24, 2024 10:08
@ebma ebma changed the title [WIP, do not merge] Spacewalk mykobo prototype Offramp prototype - Phase 2 Apr 24, 2024
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 24, 2024

‼️ Deploy request for pendulum-pay rejected.

Learn more in the Netlify docs

Name Link
🔨 Latest commit 5b4a4cc

@gianfra-t gianfra-t changed the title Offramp prototype - Phase 2 Offramp prototype - Phase 2 - Phase 3 Apr 24, 2024
@ebma ebma force-pushed the spacewalk-mykobo-prototype branch from 9aeb73c to baa28f4 Compare April 25, 2024 10:17
@ebma ebma changed the title Offramp prototype - Phase 2 - Phase 3 Offramp prototype - Phase 2 Apr 25, 2024
@TorstenStueber
Copy link
Copy Markdown
Contributor

@gianfra-t @ebma can you please add these lines to App.css – this solves the overflow problem of the wallet modal:

#react-portal-modal-container main {
  overflow-y: auto;
}

#react-portal-modal-container > div > div {
  max-height: 90vh;
}

@ebma
Copy link
Copy Markdown
Member

ebma commented Apr 25, 2024

@gianfra-t seems like you didn't reset the branch to the upstream version and now the changes that I moved to 20-phase-3-of-offramp-prototype are back on this branch again. Can you please remove the commits related to phase 3 again?

@gianfra-t
Copy link
Copy Markdown
Contributor Author

Oh sorry! Let me do that.

@gianfra-t gianfra-t force-pushed the spacewalk-mykobo-prototype branch from 5b4a4cc to 4042bc7 Compare April 25, 2024 14:52
@ebma
Copy link
Copy Markdown
Member

ebma commented Apr 26, 2024

@gianfra-t Since the testing is completed now, I think we can finally merge this PR to the staging branch and focus only on phase 3 again.

@gianfra-t
Copy link
Copy Markdown
Contributor Author

Great, I will close this. Do you know if the changes are deployed automatically on Netlify or we need to trigger manually?

@gianfra-t gianfra-t merged commit 28f2e76 into offramp-prototype-staging Apr 26, 2024
@ebma
Copy link
Copy Markdown
Member

ebma commented Apr 26, 2024

It was automatically deployed to https://offramp-prototype-staging--pendulum-pay.netlify.app/

@ebma ebma deleted the spacewalk-mykobo-prototype branch April 26, 2024 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants