Compare commits
6 Commits
optimize-b
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8f52873065 | ||
|
|
1b1d18ebaf | ||
|
|
4c6a0b5a40 | ||
|
|
0616149b6c | ||
|
|
ee86d657c9 | ||
|
|
12ebd4c1bc |
@@ -106,7 +106,6 @@
|
||||
"Account": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
|
||||
"Fee": "12",
|
||||
"Flags": "0",
|
||||
"LastLedgerSequence": 7108629,
|
||||
"OfferSequence": 6,
|
||||
"Sequence": 7
|
||||
},
|
||||
@@ -115,7 +114,6 @@
|
||||
"Account": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
|
||||
"Fee": "12",
|
||||
"Flags": "0",
|
||||
"LastLedgerSequence": 7108682,
|
||||
"Sequence": 8,
|
||||
"TakerGets": {
|
||||
"$type": "amount.xrp",
|
||||
@@ -124,8 +122,8 @@
|
||||
"TakerPays": {
|
||||
"$type": "amount.token",
|
||||
"$value": {
|
||||
"currency": "GKO",
|
||||
"issuer": "ruazs5h1qEsqpke88pcqnaseXdm6od2xc",
|
||||
"currency": "USD",
|
||||
"issuer": "rhQEswwTsjMXk75QL9Dd9RWZAokNHTzJpr",
|
||||
"value": "2"
|
||||
}
|
||||
}
|
||||
@@ -223,12 +221,11 @@
|
||||
"Account": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
|
||||
"Fee": "12",
|
||||
"Flags": "262144",
|
||||
"LastLedgerSequence": 8007750,
|
||||
"LimitAmount": {
|
||||
"$type": "amount.token",
|
||||
"$value": {
|
||||
"currency": "USD",
|
||||
"issuer": "rsP3mgGb2tcYUrxiLFiHJiQXhsziegtwBc",
|
||||
"issuer": "rhQEswwTsjMXk75QL9Dd9RWZAokNHTzJpr",
|
||||
"value": "100"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
"lodash.xor": "^4.5.0",
|
||||
"monaco-editor": "^0.33.0",
|
||||
"next": "^12.0.4",
|
||||
"next-auth": "^4.10.3",
|
||||
"next-auth": "^4.24.11",
|
||||
"next-plausible": "^3.2.0",
|
||||
"next-themes": "^0.1.1",
|
||||
"normalize-url": "^7.0.2",
|
||||
@@ -80,9 +80,12 @@
|
||||
"eslint": "7.32.0",
|
||||
"eslint-config-next": "11.1.2",
|
||||
"raw-loader": "^4.0.2",
|
||||
"typescript": "4.4.4"
|
||||
"typescript": "^4.9.5"
|
||||
},
|
||||
"resolutions": {
|
||||
"ripple-binary-codec": "=1.6.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ function MyApp({ Component, pageProps: { session, ...pageProps } }: AppProps) {
|
||||
<Alert />
|
||||
<Flex
|
||||
as="a"
|
||||
href="https://github.com/XRPLF/Hooks/discussions"
|
||||
href="https://github.com/Xahau/xrpl-hooks-ide/issues"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
css={{ position: 'fixed', right: '$4', bottom: '$4' }}
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
import NextAuth from 'next-auth'
|
||||
|
||||
declare module "next-auth" {
|
||||
interface User {
|
||||
username: string
|
||||
}
|
||||
}
|
||||
|
||||
export default NextAuth({
|
||||
// Configure one or more authentication providers
|
||||
providers: [
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 710 KiB After Width: | Height: | Size: 352 KiB |
@@ -24,6 +24,14 @@ export const fetchFiles = async (gistId: string) => {
|
||||
.includes(id)
|
||||
|
||||
if (isTemplate(gistId)) {
|
||||
const template = Object.values(templateFileIds).find(tmp => tmp.id === gistId)
|
||||
let headerFiles: Record<string, { filename: string; content: string; language: string }> =
|
||||
{}
|
||||
if (template?.headerId) {
|
||||
const resHeader = await octokit.request('GET /gists/{gist_id}', { gist_id: template.headerId })
|
||||
if (!resHeader.data.files) throw new Error('No header files could be fetched from given gist id!')
|
||||
headerFiles = resHeader.data.files as any
|
||||
} else {
|
||||
// fetch headers
|
||||
const headerRes = await fetch(
|
||||
`${process.env.NEXT_PUBLIC_COMPILE_API_BASE_URL}/api/header-files`
|
||||
@@ -37,6 +45,7 @@ export const fetchFiles = async (gistId: string) => {
|
||||
const fname = `${key}.h`
|
||||
headerFiles[fname] = { filename: fname, content: value as string, language: 'C' }
|
||||
})
|
||||
}
|
||||
const files = {
|
||||
...res.data.files,
|
||||
...headerFiles
|
||||
|
||||
@@ -4,36 +4,49 @@ import Notary from '../../components/icons/Notary'
|
||||
import Peggy from '../../components/icons/Peggy'
|
||||
import Starter from '../../components/icons/Starter'
|
||||
|
||||
export const templateFileIds = {
|
||||
type Template = {
|
||||
id: string
|
||||
name: string
|
||||
description: string
|
||||
headerId?: string
|
||||
icon: () => JSX.Element
|
||||
}
|
||||
|
||||
export const templateFileIds: Record<string, Template> = {
|
||||
starter: {
|
||||
id: '1f8109c80f504e6326db2735df2f0ad6', // Forked
|
||||
name: 'Starter',
|
||||
description:
|
||||
'Just a basic starter with essential imports, just accepts any transaction coming through',
|
||||
headerId: '028e8ce6d6d674776970caf8acc77ecc',
|
||||
icon: Starter
|
||||
},
|
||||
firewall: {
|
||||
id: '1cc30f39c8a0b9c55b88c312669ca45e', // Forked
|
||||
name: 'Firewall',
|
||||
description: 'This Hook essentially checks a blacklist of accounts',
|
||||
headerId: '028e8ce6d6d674776970caf8acc77ecc',
|
||||
icon: Firewall
|
||||
},
|
||||
notary: {
|
||||
id: '87b6f5a8c2f5038fb0f20b8b510efa10', // Forked
|
||||
name: 'Notary',
|
||||
description: 'Collecting signatures for multi-sign transactions',
|
||||
headerId: '028e8ce6d6d674776970caf8acc77ecc',
|
||||
icon: Notary
|
||||
},
|
||||
carbon: {
|
||||
id: '953662b22d065449f8ab6f69bc2afe41', // Forked
|
||||
name: 'Carbon',
|
||||
description: 'Send a percentage of sum to an address',
|
||||
headerId: '028e8ce6d6d674776970caf8acc77ecc',
|
||||
icon: Carbon
|
||||
},
|
||||
peggy: {
|
||||
id: '049784a83fa068faf7912f663f7b6471', // Forked
|
||||
name: 'Peggy',
|
||||
description: 'An oracle based stable coin hook',
|
||||
headerId: '028e8ce6d6d674776970caf8acc77ecc',
|
||||
icon: Peggy
|
||||
}
|
||||
}
|
||||
|
||||
88
yarn.lock
88
yarn.lock
@@ -64,6 +64,13 @@
|
||||
dependencies:
|
||||
regenerator-runtime "^0.13.4"
|
||||
|
||||
"@babel/runtime@^7.20.13":
|
||||
version "7.26.7"
|
||||
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.26.7.tgz#f4e7fe527cd710f8dc0618610b61b4b060c3c341"
|
||||
integrity sha512-AOPI3D+a8dXnja+iwsUqGRjr1BbZIe771sXdapOtYI531gSqpi92vXivKcq2asu/DFpdl1ceFAKZyRzK2PCVcQ==
|
||||
dependencies:
|
||||
regenerator-runtime "^0.14.0"
|
||||
|
||||
"@babel/types@^7.16.7":
|
||||
version "7.17.0"
|
||||
resolved "https://registry.npmjs.org/@babel/types/-/types-7.17.0.tgz"
|
||||
@@ -530,10 +537,10 @@
|
||||
"@octokit/webhooks-types" "5.2.0"
|
||||
aggregate-error "^3.1.0"
|
||||
|
||||
"@panva/hkdf@^1.0.1":
|
||||
version "1.0.1"
|
||||
resolved "https://registry.npmjs.org/@panva/hkdf/-/hkdf-1.0.1.tgz"
|
||||
integrity sha512-mMyQ9vjpuFqePkfe5bZVIf/H3Dmk6wA8Kjxff9RcO4kqzJo+Ek9pGKwZHpeMr7Eku0QhLXMCd7fNCSnEnRMubg==
|
||||
"@panva/hkdf@^1.0.2":
|
||||
version "1.2.1"
|
||||
resolved "https://registry.yarnpkg.com/@panva/hkdf/-/hkdf-1.2.1.tgz#cb0d111ef700136f4580349ff0226bf25c853f23"
|
||||
integrity sha512-6oclG6Y3PiDFcoyk8srjLfVKyMfVCKJ27JwNPViuXziFpmdz+MZnZN/aKY0JGXgYuO/VghU0jcOAZgWXZ1Dmrw==
|
||||
|
||||
"@radix-ui/colors@^0.1.7":
|
||||
version "0.1.8"
|
||||
@@ -1832,10 +1839,10 @@ convert-source-map@~1.1.0:
|
||||
resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.1.3.tgz#4829c877e9fe49b3161f3bf3673888e204699860"
|
||||
integrity sha512-Y8L5rp6jo+g9VEPgvqNfEopjTR4OTYct8lXlS8iVQdmnjDvbdbzYe9rjtFCB9egC86JoNCU61WRY+ScjkZpnIg==
|
||||
|
||||
cookie@^0.4.1:
|
||||
version "0.4.2"
|
||||
resolved "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz"
|
||||
integrity sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==
|
||||
cookie@^0.7.0:
|
||||
version "0.7.2"
|
||||
resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.7.2.tgz#556369c472a2ba910f2979891b526b3436237ed7"
|
||||
integrity sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==
|
||||
|
||||
core-js-pure@^3.20.2:
|
||||
version "3.21.1"
|
||||
@@ -3122,10 +3129,10 @@ javascript-time-ago@^2.3.11:
|
||||
dependencies:
|
||||
relative-time-format "^1.0.7"
|
||||
|
||||
jose@^4.1.4, jose@^4.3.7:
|
||||
version "4.10.0"
|
||||
resolved "https://registry.yarnpkg.com/jose/-/jose-4.10.0.tgz#2e0b7bcc80dd0775f8a4588e55beb9460c37d60a"
|
||||
integrity sha512-KEhB/eLGLomWGPTb+/RNbYsTjIyx03JmbqAyIyiXBuNSa7CmNrJd5ysFhblayzs/e/vbOPMUaLnjHUMhGp4yLw==
|
||||
jose@^4.15.5, jose@^4.15.9:
|
||||
version "4.15.9"
|
||||
resolved "https://registry.yarnpkg.com/jose/-/jose-4.15.9.tgz#9b68eda29e9a0614c042fa29387196c7dd800100"
|
||||
integrity sha512-1vUQX+IdDMVPj4k8kOxgUqlcK518yluMuGZwqlr44FS1ppZB/5GWh4rZG89erpOBOJjU/OBsnCVFfapsRz6nEA==
|
||||
|
||||
"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0:
|
||||
version "4.0.0"
|
||||
@@ -3772,17 +3779,17 @@ natural-compare@^1.4.0:
|
||||
resolved "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz"
|
||||
integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=
|
||||
|
||||
next-auth@^4.10.3:
|
||||
version "4.10.3"
|
||||
resolved "https://registry.yarnpkg.com/next-auth/-/next-auth-4.10.3.tgz#0a952dd5004fd2ac2ba414c990922cf9b33951a3"
|
||||
integrity sha512-7zc4aXYc/EEln7Pkcsn21V1IevaTZsMLJwapfbnKA4+JY0+jFzWbt5p/ljugesGIrN4VOZhpZIw50EaFZyghJQ==
|
||||
next-auth@^4.24.11:
|
||||
version "4.24.11"
|
||||
resolved "https://registry.yarnpkg.com/next-auth/-/next-auth-4.24.11.tgz#16eeb76d37fbc8fe887561b454f8167f490c381f"
|
||||
integrity sha512-pCFXzIDQX7xmHFs4KVH4luCjaCbuPRtZ9oBUjUhOk84mZ9WVPf94n87TxYI4rSRf9HmfHEF8Yep3JrYDVOo3Cw==
|
||||
dependencies:
|
||||
"@babel/runtime" "^7.16.3"
|
||||
"@panva/hkdf" "^1.0.1"
|
||||
cookie "^0.4.1"
|
||||
jose "^4.3.7"
|
||||
"@babel/runtime" "^7.20.13"
|
||||
"@panva/hkdf" "^1.0.2"
|
||||
cookie "^0.7.0"
|
||||
jose "^4.15.5"
|
||||
oauth "^0.9.15"
|
||||
openid-client "^5.1.0"
|
||||
openid-client "^5.4.0"
|
||||
preact "^10.6.3"
|
||||
preact-render-to-string "^5.1.19"
|
||||
uuid "^8.3.2"
|
||||
@@ -3857,9 +3864,9 @@ object-assign@^4.1.1:
|
||||
resolved "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz"
|
||||
integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=
|
||||
|
||||
object-hash@^2.0.1:
|
||||
object-hash@^2.2.0:
|
||||
version "2.2.0"
|
||||
resolved "https://registry.npmjs.org/object-hash/-/object-hash-2.2.0.tgz"
|
||||
resolved "https://registry.yarnpkg.com/object-hash/-/object-hash-2.2.0.tgz#5ad518581eefc443bd763472b8ff2e9c2c0d54a5"
|
||||
integrity sha512-gScRMn0bS5fH+IuwyIFgnh9zBdo4DV+6GhygmWM9HyNJSgS0hScp1f5vjtm7oIIOiT9trXrShAkLFSc2IqKNgw==
|
||||
|
||||
object-inspect@^1.11.0, object-inspect@^1.9.0:
|
||||
@@ -3939,10 +3946,10 @@ octokit@^1.7.0:
|
||||
"@octokit/plugin-throttling" "^3.5.1"
|
||||
"@octokit/types" "^6.26.0"
|
||||
|
||||
oidc-token-hash@^5.0.1:
|
||||
version "5.0.1"
|
||||
resolved "https://registry.npmjs.org/oidc-token-hash/-/oidc-token-hash-5.0.1.tgz"
|
||||
integrity sha512-EvoOtz6FIEBzE+9q253HsLCVRiK/0doEJ2HCvvqMQb3dHZrP3WlJKYtJ55CRTw4jmYomzH4wkPuCj/I3ZvpKxQ==
|
||||
oidc-token-hash@^5.0.3:
|
||||
version "5.0.3"
|
||||
resolved "https://registry.yarnpkg.com/oidc-token-hash/-/oidc-token-hash-5.0.3.tgz#9a229f0a1ce9d4fc89bcaee5478c97a889e7b7b6"
|
||||
integrity sha512-IF4PcGgzAr6XXSff26Sk/+P4KZFJVuHAJZj3wgO3vX2bMdNVp/QXTP3P7CEm9V1IdG8lDLY3HhiqpsE/nOwpPw==
|
||||
|
||||
once@^1.3.0, once@^1.4.0:
|
||||
version "1.4.0"
|
||||
@@ -3959,15 +3966,15 @@ open@^7.4.2:
|
||||
is-docker "^2.0.0"
|
||||
is-wsl "^2.1.1"
|
||||
|
||||
openid-client@^5.1.0:
|
||||
version "5.1.4"
|
||||
resolved "https://registry.npmjs.org/openid-client/-/openid-client-5.1.4.tgz"
|
||||
integrity sha512-36/PZY3rDgiIFj2uCL9a1fILPmIwu3HksoWO4mukgXe74ZOsEisJMMqTMfmPNw6j/7kO0mBc2xqy4eYRrB8xPA==
|
||||
openid-client@^5.4.0:
|
||||
version "5.7.1"
|
||||
resolved "https://registry.yarnpkg.com/openid-client/-/openid-client-5.7.1.tgz#34cace862a3e6472ed7d0a8616ef73b7fb85a9c3"
|
||||
integrity sha512-jDBPgSVfTnkIh71Hg9pRvtJc6wTwqjRkN88+gCFtYWrlP4Yx2Dsrow8uPi3qLr/aeymPF3o2+dS+wOpglK04ew==
|
||||
dependencies:
|
||||
jose "^4.1.4"
|
||||
jose "^4.15.9"
|
||||
lru-cache "^6.0.0"
|
||||
object-hash "^2.0.1"
|
||||
oidc-token-hash "^5.0.1"
|
||||
object-hash "^2.2.0"
|
||||
oidc-token-hash "^5.0.3"
|
||||
|
||||
optionator@^0.9.1:
|
||||
version "0.9.1"
|
||||
@@ -4489,6 +4496,11 @@ regenerator-runtime@^0.13.4:
|
||||
resolved "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz"
|
||||
integrity sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==
|
||||
|
||||
regenerator-runtime@^0.14.0:
|
||||
version "0.14.1"
|
||||
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz#356ade10263f685dda125100cd862c1db895327f"
|
||||
integrity sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==
|
||||
|
||||
regexify-string@^1.0.17:
|
||||
version "1.0.17"
|
||||
resolved "https://registry.npmjs.org/regexify-string/-/regexify-string-1.0.17.tgz"
|
||||
@@ -5166,10 +5178,10 @@ typeforce@^1.11.5:
|
||||
resolved "https://registry.npmjs.org/typeforce/-/typeforce-1.18.0.tgz"
|
||||
integrity sha512-7uc1O8h1M1g0rArakJdf0uLRSSgFcYexrVoKo+bzJd32gd4gDy2L/Z+8/FjPnU9ydY3pEnVPtr9FyscYY60K1g==
|
||||
|
||||
typescript@4.4.4:
|
||||
version "4.4.4"
|
||||
resolved "https://registry.npmjs.org/typescript/-/typescript-4.4.4.tgz"
|
||||
integrity sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA==
|
||||
typescript@^4.9.5:
|
||||
version "4.9.5"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a"
|
||||
integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==
|
||||
|
||||
umd@^3.0.0:
|
||||
version "3.0.3"
|
||||
|
||||
Reference in New Issue
Block a user