Compare commits

...
113 Commits
Author SHA1 Message Date
github-actions[bot] d9a2689469 bump: version 0.5.21 → 0.5.22 2024-12-11 22:06:07 +00:00
Prad Nukala 08d8c7eda0 chore: update debian distribution to jammy 2024-12-11 17:04:31 -05:00
Prad Nukala 4dd23f1be8 docs: add Cloudsmith badge to README 2024-12-11 17:02:07 -05:00
Prad Nukala 0ebc988a68 feat: Implement passkey-based authentication and registration flow 2024-12-11 16:43:37 -05:00
Prad Nukala 9b8af84393 docs: update changelog file path 2024-12-11 16:42:59 -05:00
github-actions[bot] ff1ccd7c78 bump: version 0.5.20 → 0.5.21 2024-12-11 21:30:55 +00:00
Prad Nukala 3176cc661a ci(deploy): improve network start/stop process in CI 2024-12-11 16:29:47 -05:00
Prad Nukala 9ba387f2e4 fix: use Unix domain sockets for devnet processes 2024-12-11 16:25:58 -05:00
Prad Nukala c87dffd6da ci(deploy): remove feature branch from deploy workflow 2024-12-11 16:20:41 -05:00
Prad Nukala 0cf69f5a59 refactor: remove unnecessary git fetch step in deploy workflow 2024-12-11 16:19:37 -05:00
Prad Nukala babab1e09e ci(deploy): improve devnet deployment workflow 2024-12-11 16:18:58 -05:00
Prad Nukala 6f5b079f51 fix: correct workflow name and improve devnet deployment process 2024-12-11 16:02:56 -05:00
Prad Nukala 9908669be0 feat: allow manual triggering of deployment workflow 2024-12-11 15:58:10 -05:00
Prad Nukala c2f3e66405 chore: update Devnet deployment workflow runner 2024-12-11 15:24:51 -05:00
Prad Nukala b24c4668ed chore: update CI workflow runner to use devnet 2024-12-11 15:24:24 -05:00
Prad Nukala fcca387d9a ci: remove unnecessary condition in deploy workflow 2024-12-11 15:13:37 -05:00
Prad Nukala 97cc6a0d21 ci: improve devnet deployment workflow by adding conditional restart 2024-12-11 15:13:18 -05:00
Prad Nukala 737565344d refactor: remove obsolete interchain test dependencies 2024-12-11 15:11:24 -05:00
Prad Nukala 72f42afb81 style: improve form layout and spacing 2024-12-11 14:57:07 -05:00
Prad Nukala 0a2b91c9ac refactor: update index views to use new nebula components 2024-12-11 14:55:19 -05:00
Prad Nukala (aider) 83b8fc597a style: Improve mobile responsiveness for Container component 2024-12-11 13:40:18 -05:00
Prad Nukala 0d4f2946f3 fix: correct title of profile creation page 2024-12-11 13:26:26 -05:00
Prad Nukala 305efbea5d feat: add start-tui command for interactive mode 2024-12-11 12:32:22 -05:00
Prad Nukala 23f077ce75 refactor: move Wasm related code to pkg/common/wasm 2024-12-11 12:26:48 -05:00
Prad Nukala d667c3c604 refactor: migrate config package to pkg directory 2024-12-11 12:24:04 -05:00
Prad Nukala 0502f52ec0 refactor: migrate to new configuration system and model definitions 2024-12-11 12:21:52 -05:00
Prad Nukala 40f50bf37a refactor: move session package to pkg directory 2024-12-11 12:07:39 -05:00
Prad Nukala 0e0a46741f docs: Trigger documentation builds on main, master, and develop branches 2024-12-11 11:49:36 -05:00
Prad Nukala 5b784659af feat: add coin selection and update passkey input in registration form 2024-12-11 11:36:52 -05:00
Prad Nukala e2f24eef8e refactor: Refactor registration forms to use UI components 2024-12-10 23:41:49 -05:00
Prad Nukala aa43770bf4 refactor: move gateway config to vault package 2024-12-10 15:28:39 -05:00
Prad Nukala 45bc823de0 refactor: improve command line flag descriptions and variable names 2024-12-10 15:27:36 -05:00
Prad Nukala 1250468f69 refactor: refactor hway command to use echo framework for server 2024-12-10 15:25:51 -05:00
Prad Nukala (aider) e94ce3b1cc refactor: Update root command to load EnvImpl from cobra flags 2024-12-10 15:21:09 -05:00
Prad Nukala ebb89facbd refactor: Modify command flags and environment loading logic in cmds.go 2024-12-10 15:21:08 -05:00
Prad Nukala 648b089c48 feat: add hway command for Sonr DID gateway 2024-12-10 15:15:24 -05:00
Prad Nukala 0befb6d431 docs: update CNAME to point to onsonr.dev 2024-12-10 15:13:21 -05:00
Prad Nukala 35f2ad604c refactor: improve build process and move process-compose.yaml 2024-12-10 15:12:53 -05:00
Prad Nukala e139aee2b3 refactor: remove unused devbox.json and related configurations 2024-12-10 15:09:32 -05:00
Prad Nukala (aider) b57bea6f7b feat: Conditionally install process-compose only if binary not found 2024-12-10 14:44:02 -05:00
Prad Nukala 1828d2e710 feat: Add process-compose support with custom start and down commands 2024-12-10 14:44:01 -05:00
Prad Nukala 04d929aae9 feat: implement passkey registration flow 2024-12-10 14:37:54 -05:00
Prad Nukala b51c36645e style: adjust styling of index page and registration form 2024-12-10 14:12:13 -05:00
Prad Nukala (aider) bd1ea5042e feat: Improve createProfile form layout with wider max-width and enhanced spacing 2024-12-10 14:05:08 -05:00
Prad Nukala af4c66bc79 feat: improve index page UI with new navigation buttons and remove redundant settings buttons 2024-12-10 13:57:25 -05:00
Prad Nukala (aider) 2d1f820451 feat: Make input rows responsive with grid layout for mobile and desktop 2024-12-10 13:56:16 -05:00
Prad Nukala (aider) 179add9e12 refactor: Improve mobile layout responsiveness for Rows and Columns components 2024-12-10 13:54:16 -05:00
Prad Nukala 9d3264256a refactor: Remove max-w-fit from Rows component 2024-12-10 13:54:14 -05:00
Prad Nukala fb234ed339 refactor: replace session package with context package 2024-12-10 13:47:07 -05:00
Prad Nukala bb7724ece1 refactor: rename database initialization function 2024-12-10 13:41:47 -05:00
Prad Nukala c67a7823a6 refactor: move session management to dedicated database module 2024-12-10 13:40:41 -05:00
Prad Nukala 518109e9df refactor: remove unused UI components related to wallet and index pages 2024-12-10 13:33:01 -05:00
Prad Nukala e38a045de3 feat: enhance index page with additional settings buttons and style adjustments 2024-12-10 13:27:07 -05:00
Prad Nukala ba82d707d0 refactor: consolidate handlers into single files 2024-12-10 13:13:51 -05:00
Prad Nukala f366dd8cf2 feat: implement passkey-based authentication 2024-12-10 13:12:08 -05:00
Prad Nukala dc6f02a000 refactor: move gateway and vault packages to internal directory 2024-12-10 12:52:19 -05:00
Prad Nukala b81bdebd64 refactor: Move registration form components to dedicated directory 2024-12-10 02:43:28 -05:00
Prad Nukala (aider) 6127d80f2a style: Improve mobile responsiveness for create profile form 2024-12-10 00:46:38 -05:00
Prad Nukala 49c8a8c6d0 feat: add support for Cloudsmith releases 2024-12-10 00:42:52 -05:00
Prad Nukala e2e0c35008 refactor: remove unused devbox package 2024-12-09 22:36:06 -05:00
Prad Nukala 1de6eda49f feat: add go dependency and enhance devbox environment variables 2024-12-09 22:35:00 -05:00
Prad Nukala 000a0893c3 fix: rename devbox start script to up and remove stop script 2024-12-09 22:00:58 -05:00
Prad Nukala 0a68ab682d feat: update create profile form placeholders and handle 2024-12-09 21:45:52 -05:00
Prad Nukala (aider) 54e51768c0 fix: Consolidate archive configuration and add LICENSE file 2024-12-09 20:22:23 -05:00
Prad Nukala 4eb294d856 refactor: remove devbox configuration 2024-12-09 19:40:06 -05:00
Prad Nukala e3b8f2cffe refactor: move vault package to app directory 2024-12-09 18:39:57 -05:00
Prad Nukala c158904efc refactor: improve code structure within gateway package 2024-12-09 18:35:36 -05:00
Prad Nukala f250082fff refactor: move gateway package to app directory 2024-12-09 18:34:38 -05:00
Prad Nukala 67432d3fdf refactor: move vault package internal components to root 2024-12-09 18:31:12 -05:00
Prad Nukala 0ff4299061 refactor: migrate layout imports to common styles package 2024-12-09 18:30:02 -05:00
Prad Nukala 8ceb89053f refactor: Move form templates and styles to common directory 2024-12-09 18:27:55 -05:00
Prad Nukala 6fbcb7cef5 feat: add DID-based authentication middleware 2024-12-09 18:24:27 -05:00
Prad Nukala f8d362352d refactor: consolidate authentication and DID handling logic 2024-12-09 18:19:46 -05:00
Prad Nukala (aider) ce3d073abd feat: Add validation for human verification slider sum in CreateProfile form 2024-12-09 17:36:09 -05:00
Prad Nukala 0e8b92e53d feat: implement passkey registration flow 2024-12-09 16:23:18 -05:00
Prad Nukala (aider) 27d4dfcdfd refactor: Improve WebAuthn credential handling and validation in register finish route 2024-12-09 15:23:41 -05:00
Prad Nukala (aider) 38096db2dd fix: Improve cross-browser passkey credential handling and encoding 2024-12-09 15:21:18 -05:00
Prad Nukala bbb093b171 refactor: remove profile card component 2024-12-09 15:21:02 -05:00
Prad Nukala (aider) 98bdf92d70 feat: Update WebAuthn credential handling with modern browser standards 2024-12-09 15:12:16 -05:00
Prad Nukala e572d7a626 fix: Remove commented-out code in passkey registration script 2024-12-09 15:12:14 -05:00
Prad Nukala (aider) aff4e3523c feat: Streamline passkey registration with automatic form submission 2024-12-09 15:09:05 -05:00
Prad Nukala 9972c5e40a refactor: Simplify passkey registration UI and move profile component inline 2024-12-09 15:09:03 -05:00
Prad Nukala (aider) 2915ba2933 refactor: Update credential logging with transport and ID type 2024-12-09 14:59:35 -05:00
Prad Nukala (aider) 3d9264dae4 refactor: Update register handler to use protocol.CredentialDescriptor struct 2024-12-09 14:59:25 -05:00
Prad Nukala d030dbcfde refactor: Update credential handling to use protocol.CredentialDescriptor 2024-12-09 14:59:24 -05:00
Prad Nukala (aider) 60cede383a feat: Add credential parsing and logging in register finish handler 2024-12-09 14:55:31 -05:00
Prad Nukala (aider) 7ef06e8d05 feat: Add credential details row with icon after passkey creation 2024-12-09 14:53:59 -05:00
Prad Nukala (aider) e8475dbd8d feat: Add form validation for passkey credential input 2024-12-09 14:51:59 -05:00
Prad Nukala 3353d9f622 feat: implement passkey registration flow 2024-12-09 14:51:12 -05:00
Prad Nukala (aider) 893631eb4c feat: Add hidden input to store passkey credential data for form submission 2024-12-09 14:45:02 -05:00
Prad Nukala 2286708d56 refactor: improve profile card styling and functionality 2024-12-09 14:42:07 -05:00
Prad Nukala 553cff37a1 feat: add CI workflow for deploying network 2024-12-09 13:37:55 -05:00
Prad Nukala 7806c07381 feat: add hway binary support and Homebrew formula 2024-12-09 11:49:20 -05:00
Prad Nukala b7a40ac3d7 feat: remove username from passkey creation 2024-12-08 23:30:17 -05:00
Prad Nukala 5280209075 feat: implement passkey registration flow 2024-12-08 23:10:40 -05:00
Prad Nukala e0ebe92361 feat: add passkey creation functionality 2024-12-08 22:53:04 -05:00
Prad Nukala 5c3966a9d6 fix: remove line-clamp from tailwind config 2024-12-08 21:45:37 -05:00
Prad Nukala 38ca7b246b refactor: Simplify session management and browser information extraction 2024-12-08 19:46:19 -05:00
Prad Nukala (aider) d9f2b21812 refactor: Update PeerInfo to extract and store comprehensive device information 2024-12-08 19:45:14 -05:00
Prad Nukala fb9f41248f docs: Update CNAME to point to www.onsonr.dev 2024-12-08 18:48:44 -05:00
Prad Nukala 4087fdd79e refactor: improve address display in property details 2024-12-08 18:48:04 -05:00
Prad Nukala 6bb2c2143e refactor: remove unused documentation generation script 2024-12-08 17:55:36 -05:00
Prad Nukala dae01698ef refactor: replace sonr/pkg/styles/layout with nebula/ui/layout 2024-12-08 16:17:46 -05:00
Prad Nukala b65e844824 refactor: migrate UI components to nebula module 2024-12-08 16:17:21 -05:00
Prad Nukala c64c506c52 feat: add CNAME for onsonr.dev domain 2024-12-08 14:52:40 -05:00
Prad Nukala 889186ec3e docs: Force update of GitHub Pages deployment 2024-12-08 13:36:53 -05:00
Prad Nukala 9b3c89785e docs(github): update workflow to remove redundant branch configuration 2024-12-08 13:35:40 -05:00
Prad Nukala cfce4ba460 fix: remove unnecessary background and restart settings from process-compose.yaml 2024-12-08 13:00:38 -05:00
Prad Nukala 3cb72d89e9 fix: suppress process-compose server output and log to file 2024-12-08 12:42:39 -05:00
Prad Nukala cb6fb10c3c docs: Add keywords to improve documentation searchability 2024-12-08 12:29:59 -05:00
Prad Nukala 0c5f052f86 build: add newline for better readability 2024-12-08 11:59:25 -05:00
Prad Nukala c36dc537ef refactor: improve scopes.json structure and update scripts for better usability 2024-12-07 17:32:11 -05:00
Prad Nukala 4af64c8524 docs: remove --force flag from mkdocs gh-deploy 2024-12-06 21:36:37 -05:00
219 changed files with 3286 additions and 10080 deletions
+2 -1
View File
@@ -2,6 +2,7 @@
name = "cz_conventional_commits"
tag_format = "v$version"
version_scheme = "semver"
version = "0.5.20"
version = "0.5.22"
update_changelog_on_bump = true
major_version_zero = true
changelog_file = "./docs/docs/changelog/index.md"
+306 -68
View File
@@ -1,82 +1,218 @@
[
{
"name": "cosmos/sdk",
"name": "app/cosmos-sdk",
"path": "app",
"docs": [
"https://docs.cosmos.network/v0.50/build/building-modules/module-manager",
"https://docs.cosmos.network/v0.50/build/building-modules/messages-and-queries",
"https://docs.cosmos.network/v0.50/build/building-modules/msg-services",
"https://docs.cosmos.network/v0.50/build/building-modules/query-services",
"https://docs.cosmos.network/v0.50/build/building-modules/depinject"
{
"keywords": [
"module",
"cosmos"
],
"url": "https://docs.cosmos.network/v0.50/build/building-modules/module-manager"
},
{
"keywords": [
"protobuf",
"cosmos"
],
"url": "https://docs.cosmos.network/v0.50/build/building-modules/messages-and-queries"
},
{
"keywords": [
"rpc",
"protobuf",
"service",
"cosmos"
],
"url": "https://docs.cosmos.network/v0.50/build/building-modules/msg-services"
},
{
"keywords": [
"protobuf",
"rpc",
"cosmos",
"query"
],
"url": "https://docs.cosmos.network/v0.50/build/building-modules/query-services"
},
{
"keywords": [
"cosmos",
"depinject",
"sdk"
],
"url": "https://docs.cosmos.network/v0.50/build/building-modules/depinject"
}
]
},
{
"name": "cosmos/ibc",
"name": "app/ibc",
"path": "app",
"docs": [
"https://ibc.cosmos.network/v8/apps/interchain-accounts/overview/",
"https://ibc.cosmos.network/v8/apps/transfer/overview/",
"https://docs.osmosis.zone/osmosis-core/asset-info/",
"https://docs.osmosis.zone/osmosis-core/modules/tokenfactory",
"https://docs.noble.xyz/cctp/mint",
"https://docs.noble.xyz/cctp/mint_forward",
"https://docs.evmos.org/protocol/modules/erc20",
"https://docs.nomic.io/nbtc"
{
"keywords": [
"cosmos",
"interchain",
"accounts"
],
"url": "https://ibc.cosmos.network/v8/apps/interchain-accounts/overview/"
},
{
"keywords": [],
"url": "https://ibc.cosmos.network/v8/apps/transfer/overview/"
},
{
"keywords": [],
"url": "https://docs.osmosis.zone/osmosis-core/asset-info/"
},
{
"keywords": [],
"url": "https://docs.osmosis.zone/osmosis-core/modules/tokenfactory"
},
{
"keywords": [
"usdc",
"mint",
"cosmos",
"noble"
],
"url": "https://docs.noble.xyz/cctp/mint"
},
{
"keywords": [
"usdc"
],
"url": "https://docs.noble.xyz/cctp/mint_forward"
},
{
"keywords": [],
"url": "https://docs.evmos.org/protocol/modules/erc20"
},
{
"keywords": [],
"url": "https://docs.nomic.io/nbtc"
}
]
},
{
"name": "crypto/mpc",
"path": "crypto/mpc",
"docs": [
"https://csrc.nist.gov/CSRC/media/Events/NTCW19/papers/paper-DKLS.pdf"
{
"keywords": [
"mpc",
"wallet",
"security",
"advanced cryptography"
],
"url": "https://csrc.nist.gov/CSRC/media/Events/NTCW19/papers/paper-DKLS.pdf"
}
]
},
{
"name": "crypto/ucan",
"path": "crypto/ucan",
"docs": [
"https://raw.githubusercontent.com/ucan-wg/spec/refs/heads/main/README.md"
{
"keywords": [],
"url": "https://raw.githubusercontent.com/ucan-wg/spec/refs/heads/main/README.md"
}
]
},
{
"name": "crypto/zkp",
"path": "crypto/accumulator",
"docs": [
"https://eprint.iacr.org/2021/1672.pdf"
{
"keywords": [],
"url": "https://eprint.iacr.org/2021/1672.pdf"
}
]
},
{
"name": "gateway/handlers",
"path": "pkg/gateway/handlers",
"docs": [
"https://echo.labstack.com/docs/cookbook/sse",
"https://echo.labstack.com/docs/cookbook/websocket",
"https://echo.labstack.com/docs/cookbook/subdomain"
{
"keywords": [],
"url": "https://echo.labstack.com/docs/cookbook/sse"
},
{
"keywords": [],
"url": "https://echo.labstack.com/docs/cookbook/websocket"
},
{
"keywords": [],
"url": "https://echo.labstack.com/docs/cookbook/subdomain"
}
]
},
{
"name": "gateway/database",
"path": "pkg/gateway/internal/database",
"docs": [
"https://docs.tigerbeetle.com/coding/data-modeling",
"https://docs.tigerbeetle.com/coding/two-phase-transfers",
"https://docs.tigerbeetle.com/coding/reliable-transaction-submission",
"https://docs.tigerbeetle.com/coding/recipes/currency-exchange",
"https://docs.tigerbeetle.com/coding/recipes/balance-conditional-transfers",
"https://docs.tigerbeetle.com/reference/account",
"https://docs.tigerbeetle.com/reference/transfer",
"https://docs.substreams.dev/documentation/consume/packages",
"https://docs.substreams.dev/documentation/consume/sql/deployable-services/local-service",
"https://docs.substreams.dev/tutorials/cosmos/injective/foundational"
{
"keywords": [],
"url": "https://docs.tigerbeetle.com/coding/data-modeling"
},
{
"keywords": [],
"url": "https://docs.tigerbeetle.com/coding/two-phase-transfers"
},
{
"keywords": [],
"url": "https://docs.tigerbeetle.com/coding/reliable-transaction-submission"
},
{
"keywords": [
"currency"
],
"url": "https://docs.tigerbeetle.com/coding/recipes/currency-exchange"
},
{
"keywords": [
"balance"
],
"url": "https://docs.tigerbeetle.com/coding/recipes/balance-conditional-transfers"
},
{
"keywords": [],
"url": "https://docs.tigerbeetle.com/reference/account"
},
{
"keywords": [],
"url": "https://docs.tigerbeetle.com/reference/transfer"
},
{
"keywords": [],
"url": "https://docs.substreams.dev/documentation/consume/packages"
},
{
"keywords": [],
"url": "https://docs.substreams.dev/documentation/consume/sql/deployable-services/local-service"
},
{
"keywords": [],
"url": "https://docs.substreams.dev/tutorials/cosmos/injective/foundational"
}
]
},
{
"name": "vault/handlers",
"path": "pkg/vault/handlers",
"docs": [
"https://echo.labstack.com/docs/cookbook/jwt",
"https://echo.labstack.com/docs/middleware/secure",
"https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API"
{
"keywords": [],
"url": "https://echo.labstack.com/docs/cookbook/jwt"
},
{
"keywords": [],
"url": "https://echo.labstack.com/docs/middleware/secure"
},
{
"keywords": [],
"url": "https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API"
}
]
},
{
@@ -92,16 +228,28 @@
"name": "pkl/ipfs",
"path": "pkl/ipfs.net",
"docs": [
"https://github.com/ipfs/kubo/blob/master/docs/config.md",
"https://pkl-lang.org/main/current/language-reference/index.html"
{
"keywords": [],
"url": "https://github.com/ipfs/kubo/blob/master/docs/config.md"
},
{
"keywords": [],
"url": "https://pkl-lang.org/main/current/language-reference/index.html"
}
]
},
{
"name": "pkl/matrix",
"path": "pkl/matrix.net",
"docs": [
"https://element-hq.github.io/synapse/latest/usage/configuration/config_documentation.html",
"https://pkl-lang.org/main/current/language-reference/index.html"
{
"keywords": [],
"url": "https://element-hq.github.io/synapse/latest/usage/configuration/config_documentation.html"
},
{
"keywords": [],
"url": "https://pkl-lang.org/main/current/language-reference/index.html"
}
]
},
{
@@ -118,72 +266,162 @@
"name": "pkl/hway",
"path": "pkl/sonr.hway",
"docs": [
"https://pkl-lang.org/main/current/language-reference/index.html"
{
"keywords": [],
"url": "https://pkl-lang.org/main/current/language-reference/index.html"
}
]
},
{
"name": "pkl/motr",
"path": "pkl/sonr.motr",
"docs": [
"https://pkl-lang.org/main/current/language-reference/index.html",
"https://web.dev/learn/pwa/service-workers/",
"https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API"
{
"keywords": [],
"url": "https://pkl-lang.org/main/current/language-reference/index.html"
},
{
"keywords": [],
"url": "https://web.dev/learn/pwa/service-workers/"
},
{
"keywords": [],
"url": "https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API"
}
]
},
{
"name": "x/did",
"path": "proto/did",
"docs": [
"https://docs.cosmos.network/v0.50/build/packages/orm",
"https://docs.cosmos.network/v0.50/build/building-modules/protobuf-annotations",
"https://docs.cosmos.network/v0.50/build/modules/auth",
"https://docs.cosmos.network/v0.50/build/packages/collections",
"https://docs.cosmos.network/v0.50/build/modules/bank"
{
"keywords": [],
"url": "https://docs.cosmos.network/v0.50/build/packages/orm"
},
{
"keywords": [],
"url": "https://docs.cosmos.network/v0.50/build/building-modules/protobuf-annotations"
},
{
"keywords": [],
"url": "https://docs.cosmos.network/v0.50/build/modules/auth"
},
{
"keywords": [],
"url": "https://docs.cosmos.network/v0.50/build/packages/collections"
},
{
"keywords": [],
"url": "https://docs.cosmos.network/v0.50/build/modules/bank"
}
]
},
{
"name": "x/dwn",
"path": "proto/dwn",
"docs": [
"https://docs.cosmos.network/v0.50/build/building-modules/protobuf-annotations",
"https://docs.cosmos.network/v0.50/build/packages/orm",
"https://docs.cosmos.network/v0.50/build/modules/authz",
"https://docs.cosmos.network/v0.50/build/packages/collections",
"https://docs.cosmos.network/v0.50/build/modules/gov",
"https://docs.cosmos.network/v0.50/build/modules/staking"
{
"keywords": [],
"url": "https://docs.cosmos.network/v0.50/build/building-modules/protobuf-annotations"
},
{
"keywords": [],
"url": "https://docs.cosmos.network/v0.50/build/packages/orm"
},
{
"keywords": [],
"url": "https://docs.cosmos.network/v0.50/build/modules/authz"
},
{
"keywords": [],
"url": "https://docs.cosmos.network/v0.50/build/packages/collections"
},
{
"keywords": [],
"url": "https://docs.cosmos.network/v0.50/build/modules/gov"
},
{
"keywords": [],
"url": "https://docs.cosmos.network/v0.50/build/modules/staking"
}
]
},
{
"name": "x/svc",
"path": "proto/svc",
"docs": [
"https://docs.cosmos.network/v0.50/build/packages/collections",
"https://docs.cosmos.network/v0.50/build/building-modules/protobuf-annotations",
"https://docs.cosmos.network/v0.50/build/packages/orm",
"https://docs.cosmos.network/v0.50/build/modules/group",
"https://docs.cosmos.network/v0.50/build/modules/nft"
{
"keywords": [],
"url": "https://docs.cosmos.network/v0.50/build/packages/collections"
},
{
"keywords": [],
"url": "https://docs.cosmos.network/v0.50/build/building-modules/protobuf-annotations"
},
{
"keywords": [],
"url": "https://docs.cosmos.network/v0.50/build/packages/orm"
},
{
"keywords": [],
"url": "https://docs.cosmos.network/v0.50/build/modules/group"
},
{
"keywords": [],
"url": "https://docs.cosmos.network/v0.50/build/modules/nft"
}
]
},
{
"name": "repo/ci-cd",
"path": "deploy",
"docs": [
"https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions",
"https://docs.cosmos.network/v0.50/build/tooling/cosmovisor",
"https://f1bonacc1.github.io/process-compose/configuration/",
"https://docs.nomic.io/network/ibc-relayer",
"https://www.jetify.com/docs/devbox",
"https://taskfile.dev/reference/cli",
"https://taskfile.dev/reference/schema",
"https://taskfile.dev/reference/templating/"
{
"keywords": [],
"url": "https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions"
},
{
"keywords": [],
"url": "https://docs.cosmos.network/v0.50/build/tooling/cosmovisor"
},
{
"keywords": [],
"url": "https://f1bonacc1.github.io/process-compose/configuration/"
},
{
"keywords": [],
"url": "https://docs.nomic.io/network/ibc-relayer"
},
{
"keywords": [],
"url": "https://www.jetify.com/docs/devbox"
},
{
"keywords": [],
"url": "https://taskfile.dev/reference/cli"
},
{
"keywords": [],
"url": "https://taskfile.dev/reference/schema"
},
{
"keywords": [],
"url": "https://taskfile.dev/reference/templating/"
}
]
},
{
"name": "repo/docs",
"path": "docs",
"docs": [
"https://squidfunk.github.io/mkdocs-material/reference/",
"https://github.com/mkdocs/catalog/blob/main/README.md"
{
"keywords": [],
"url": "https://squidfunk.github.io/mkdocs-material/reference/"
},
{
"keywords": [],
"url": "https://github.com/mkdocs/catalog/blob/main/README.md"
}
]
}
]
-7
View File
@@ -1,7 +0,0 @@
#!/usr/bin/env bash
set -e
ROOT_DIR=$(git rev-parse --show-toplevel)
+3 -3
View File
@@ -6,7 +6,7 @@ ROOT_DIR=$(git rev-parse --show-toplevel)
# Extract scope name and path using jq, and pass it to fzf for selection
SCOPE=$(cat "$ROOT_DIR/.github/scopes.json" | jq -r '.[] | "\(.name)"' | fzf --prompt "Select scope:")
DOCS=$(cat "$ROOT_DIR/.github/scopes.json" | jq -r ".[] | select(.name == \"$SCOPE\") | .docs[]")
DOCS=$(cat "$ROOT_DIR/.github/scopes.json" | jq -r ".[] | select(.name == \"$SCOPE\") | .docs[].url")
# Write Title
TITLE=$(gum input --placeholder "Issue Title...")
@@ -38,9 +38,9 @@ create_body() {
echo "$(($i + 1)). ${REQUIREMENTS[$i]}"
done
echo "### Resources:"
for doc in "${DOCS[@]}"; do
while IFS= read -r doc; do
echo "- $doc"
done
done <<< "$DOCS"
}
ISSUE_BODY=$(create_body)
+34
View File
@@ -0,0 +1,34 @@
name: Deploy Networks
on:
workflow_dispatch:
push:
tags:
- "v*"
branches:
- develop
permissions:
contents: write
issues: write
jobs:
reboot-devnet:
name: Devnet Deploy
runs-on: goliath
environment: "Devnet"
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
branch: develop
- name: Stop Existing Network
continue-on-error: true
run: |
make stop-uds
make clean
- name: Start Updated Network
run: |
make start-uds
+5
View File
@@ -2,7 +2,12 @@ name: Publish Docs via GitHub Pages
on:
push:
branches:
- main
- master
- develop
paths:
- "docs/**"
permissions:
contents: write
jobs:
+1
View File
@@ -46,3 +46,4 @@ jobs:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
CLOUDSMITH_TOKEN: ${{ secrets.CLOUDSMITH_TOKEN }}
+5
View File
@@ -41,6 +41,7 @@ go.work.sum
# Environment files
.env
**/*.env
**/sonr.log
# Terraform
@@ -60,6 +61,10 @@ override.tf.json
.terraformrc
terraform.rc
Taskfile.yml
!deploy/**/Taskfile.yml
# Misc
.DS_Store
.tmp/
+151 -23
View File
@@ -4,24 +4,163 @@ project_name: sonr
builds:
- id: sonr
goos: [linux, darwin]
goarch: [amd64, arm64]
main: ./cmd/sonrd
binary: sonrd
builder: go
gobinary: go
command: build
mod_timestamp: "{{ .CommitTimestamp }}"
goos:
- linux
- darwin
goarch:
- amd64
- arm64
goamd64:
- v1
flags:
- -mod=readonly
- -trimpath
ldflags:
- -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}}
- -X github.com/cosmos/cosmos-sdk/version.Name=sonr
- -X github.com/cosmos/cosmos-sdk/version.AppName=sonrd
- -X github.com/cosmos/cosmos-sdk/version.Version={{.Version}}
- -X github.com/cosmos/cosmos-sdk/version.Commit={{.Commit}}
- -X "github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger"
tags:
- netgo
- ledger
- id: hway
main: ./cmd/hway
binary: hway
builder: go
gobinary: go
goos:
- linux
- darwin
goarch:
- amd64
- arm64
mod_timestamp: "{{ .CommitTimestamp }}"
flags:
- -mod=readonly
- -trimpath
goamd64:
- v1
tags:
- netgo
ldflags:
- -X main.version={{.Version}}
- -X main.commit={{.Commit}}
- -X main.date={{.Date}}
archives:
- id: sonr
builds: [sonr]
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ with .Arm }}v{{ . }}{{ end }}{{ with .Mips }}_{{ . }}{{ end }}{{ if not (eq .Amd64 "v1") }}{{ .Amd64 }}{{ end }}'
name_template: >-
sonr_{{ .Version }}_
{{- title .Os }}_{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
format: tar.gz
files:
- src: README*
- src: CHANGELOG*
wrap_in_directory: true
- id: hway
builds: [hway]
name_template: >-
hway_{{ .Version }}_
{{- title .Os }}_{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
format: tar.gz
files:
- src: README*
- src: CHANGELOG*
wrap_in_directory: true
nfpms:
- id: hway
package_name: hway
file_name_template: "{{ .ConventionalFileName }}"
builds: [hway]
vendor: Sonr
homepage: "https://onsonr.dev"
maintainer: "Sonr <support@onsonr.dev>"
description: "Sonr Highway is a decentralized, permissionless, and censorship-resistant identity network proxy."
license: "Apache 2.0"
formats:
- rpm
- deb
- apk
dependencies:
- ipfs
contents:
- src: README*
dst: /usr/share/doc/hway
bindir: /usr/bin
section: net
priority: optional
# Add these lines to match build config
- id: sonr
package_name: sonrd
file_name_template: "{{ .ConventionalFileName }}"
builds: [sonr]
vendor: Sonr
homepage: "https://onsonr.dev"
maintainer: "Sonr <support@onsonr.dev>"
description: "Sonr is a decentralized, permissionless, and censorship-resistant identity network."
license: "Apache 2.0"
formats:
- rpm
- deb
- apk
dependencies:
- ipfs
contents:
- src: README*
dst: /usr/share/doc/sonrd
bindir: /usr/bin
section: net
priority: optional
# Add these lines to match build config
brews:
- name: hway
ids: [hway]
commit_author:
name: goreleaserbot
email: bot@goreleaser.com
directory: Formula
caveats: "Run a local hway node and access it with the hway proxy"
homepage: "https://onsonr.dev"
description: "Sonr is a decentralized, permissionless, and censorship-resistant identity network."
dependencies:
- name: ipfs
repository:
owner: onsonr
name: homebrew-tap
branch: master
token: "{{ .Env.GITHUB_PERSONAL_AUTH_TOKEN }}"
- name: sonr
ids: [sonr]
commit_author:
name: goreleaserbot
email: bot@goreleaser.com
directory: Formula
caveats: "Run a local sonr node and access it with the hway proxy"
homepage: "https://onsonr.dev"
description: "Sonr is a decentralized, permissionless, and censorship-resistant identity network."
dependencies:
- name: ipfs
repository:
owner: onsonr
name: homebrew-tap
branch: master
token: "{{ .Env.GITHUB_PERSONAL_AUTH_TOKEN }}"
release:
github:
@@ -34,25 +173,14 @@ release:
extra_files:
- glob: ./CHANGELOG*
- glob: ./README*
- glob: ./LICENSE*
brews:
- name: sonr
ids: [sonr]
commit_author:
name: goreleaserbot
email: bot@goreleaser.com
directory: Formula
caveats: "Run a local sonr node and access it with the hway proxy"
homepage: "https://sonr.io/"
description: "Sonr is a decentralized, permissionless, and censorship-resistant identity network."
dependencies:
- name: ipfs
repository:
owner: onsonr
name: homebrew-tap
branch: master
token: "{{ .Env.GITHUB_PERSONAL_AUTH_TOKEN }}"
cloudsmiths:
- organization: sonr
repository: sonr
distributions:
deb: "ubuntu/jammy"
alpine: "alpine/v3.8"
rpm: "el/7"
announce:
telegram:
-498
View File
@@ -1,498 +0,0 @@
## v0.5.20 (2024-12-07)
### Refactor
- simplify CI workflow by removing redundant asset publishing steps
## v0.5.19 (2024-12-06)
### Feat
- add support for parent field and resources list in Capability message
- add fast reflection methods for Capability and Resource
- add gum package and update devbox configuration
- add new button components and layout improvements
### Fix
- adjust fullscreen modal close button margin
- update devbox lockfile
- resolve rendering issue in login modal
### Refactor
- rename accaddr package to address
- Update Credential table to match WebAuthn Credential Descriptor
- Deployment setup
- migrate build system from Taskfile to Makefile
- rename Assertion to Account and update related code
- remove unused TUI components
- Move IPFS interaction functions to common package
- remove dependency on DWN.pkl
- remove unused dependencies and simplify module imports
- Rename x/vault -> x/dwn and x/service -> x/svc
- move resolver formatter to services package
- remove web documentation
- update devbox configuration and scripts
- rename layout component to root
- refactor authentication pages into their own modules
- update templ version to v0.2.778 and remove unused air config
- move signer implementation to mpc package
## v0.5.18 (2024-11-06)
## v0.5.17 (2024-11-05)
### Feat
- add remote client constructor
- add avatar image components
- add SVG CDN Illustrations to marketing architecture
- **marketing**: refactor marketing page components
- Refactor intro video component to use a proper script template
- Move Alpine.js script initialization to separate component
- Add intro video modal component
- add homepage architecture section
- add Hero section component with stats and buttons
- **css**: add new utility classes for group hover
- implement authentication register finish endpoint
- add controller creation step to allocate
- Update service module README based on protobuf files
- Update x/macaroon/README.md with details from protobuf files
- update Vault README with details from proto files
### Fix
- update file paths in error messages
- update intro video modal script
- include assets generation in wasm build
### Refactor
- update marketing section architecture
- change verification table id
- **proto**: remove macaroon proto
- rename ValidateBasic to Validate
- rename session cookie key
- remove unused sync-initial endpoint
- remove formatter.go from service module
## v0.5.16 (2024-10-21)
## v0.5.15 (2024-10-21)
## v0.5.14 (2024-10-21)
### Refactor
- remove StakingKeeper dependency from GlobalFeeDecorator
## v0.5.13 (2024-10-21)
### Feat
- add custom secp256k1 pubkey
### Refactor
- update gRPC client to use new request types
- use RawPublicKey instead of PublicKey in macaroon issuer
- improve error handling in DID module
## v0.5.12 (2024-10-18)
### Feat
- add User-Agent and Platform to session
- introduce AuthState enum for authentication state
### Fix
- **version**: revert version bump to 0.5.11
- **version**: update version to 0.5.12
### Refactor
- remove dependency on proto change detection
- update asset publishing configuration
## v0.5.11 (2024-10-10)
### Feat
- nebula assets served from CDN
- use CDN for nebula frontend assets
- add static hero section content to homepage
- add wrangler scripts for development, build, and deployment
- remove build configuration
- move gateway web code to dedicated directory
- add PubKey fast reflection
- **macaroon**: add transaction allowlist/denylist caveats
- add PR labeler
- **devbox**: remove hway start command
- add GitHub Actions workflow for running tests
- add workflow for deploying Hway to Cloudflare Workers
- Publish configs to R2
- integrate nebula UI with worker-assets-gen
- extract reusable layout components
- Implement service worker for IPFS vault
- implement CDN support for assets
- add payment method support
- add support for public key management
- add ModalForm component
- add LoginStart and RegisterStart routes
- implement authentication views
- add json tags to config structs
- implement templ forms for consent privacy, credential assert, credential register, and profile details
- **vault**: introduce assembly of the initial vault
- add client logos to homepage
- add tailwind utility classes
- implement new profile card component
### Fix
- Correct source directory for asset publishing
- install dependencies before nebula build
- update Schema service to use new API endpoint
- fix broken logo image path
### Refactor
- remove unnecessary branch configuration from scheduled release workflow
- update dwn configuration generation import path
- use nebula/routes instead of nebula/global
- move index template to routes package
- remove cdn package and move assets to global styles
- move nebula assets to hway build directory
- remove docker build and deployment
- rename internal/session package to internal/ctx
- remove unused fields from
- rename PR_TEMPLATE to PULL_REQUEST_TEMPLATE
- remove devbox.json init hook
- rename sonrd dockerfile to Dockerfile
- remove unused dependency
- rename 'global/cdn' to 'assets'
- move CDN assets to separate folder
- move Pkl module definitions to dedicated package
- move CDN assets to js/ folder
- remove unused component templates
- move ui components to global
- move view handlers to router package
## v0.5.10 (2024-10-07)
### Feat
- **blocks**: remove button component
## v0.5.9 (2024-10-06)
### Feat
- add Motr support
- update UIUX PKL to utilize optional fields
### Fix
- Update source directory for asset publishing
## v0.5.8 (2024-10-04)
### Refactor
- Remove unused logs configuration
## v0.5.7 (2024-10-04)
### Feat
- **devbox**: use process-compose for testnet services
- remove motr.mjs dependency
- add markdown rendering to issue templates
- update issue templates for better clarity
- add issue templates for tracking and task issues
- add issue templates for bug report and tracking
- introduce docker-compose based setup
### Refactor
- update issue template headings
- rename bug-report issue template to bug
## v0.5.6 (2024-10-03)
### Feat
- add hway and sonr processes to dev environment
## v0.5.5 (2024-10-03)
### Feat
- add rudimentary DidController table
- update home section with new features
- introduce Home model and refactor views
- **nebula**: create Home model for home page
### Refactor
- reorganize pkl files for better separation of concerns
- rename msg_server_test.go to rpc_test.go
## v0.5.4 (2024-10-02)
## v0.5.3 (2024-10-02)
### Fix
- remove unnecessary telegram message template
## v0.5.2 (2024-10-02)
### Feat
- **service**: integrate group module (#1104)
### Refactor
- revert version bump to 0.5.1
## v0.5.1 (2024-10-02)
### Refactor
- move Motr API to state package
## v0.5.0 (2024-10-02)
### Feat
- allow multiple macaroons with the same id
## v0.4.5 (2024-10-02)
### Fix
- use correct secret for docker login
## v0.4.4 (2024-10-02)
## v0.4.3 (2024-10-02)
### Feat
- **release**: add docker images for sonrd and motr
- update homepage with new visual design
- add DID to vault genesis schema
- add video component
- add video component
- add hx-get attribute to primary button in hero section
### Fix
- **layout**: add missing favicon
- **hero**: Use hx-swap for primary button to prevent flicker
### Refactor
- use single GITHUB_TOKEN for release workflow
- update workflow variables
## v0.4.2 (2024-10-01)
### Refactor
- use single GITHUB_TOKEN for release workflow
## v0.4.1 (2024-10-01)
### Feat
- Implement session management
- allow manual release triggers
- add Input and RegistrationForm models
- add new utility classes
- add login and registration pages
- add tailwindcss utilities
- add support for ARM64 architecture
- add DWN resolver field
- add stats section to homepage
- implement hero section using Pkl
- add PKL schema for message formats
- add Homebrew tap for sonr
- update release workflow to use latest tag
### Fix
- **version**: update version number to 0.4.0
- update release workflow to use latest tag
- **versioning**: revert version to 0.9.0
- **cta**: Fix typo in CTA title
- change bento section title to reflect security focus
- adjust hero image dimensions
- **Input**: Change type from to
- update hero image height in config.pkl
### Refactor
- move home page sections to home package
- rename motrd to motr
- update hero image dimensions
- move nebula configuration to static file
- rename buf-publish.yml to publish-assets.yml
- remove unused field from
## v0.4.0 (2024-09-30)
### Feat
- **dwn**: add wasm build for dwn
- add macaroon and oracle genesis states
- add scheduled binary release workflow
- introduce process-compose for process management
- add counter animation to hero section
- add registration page
### Fix
- Enable scheduled release workflow
### Refactor
- remove old changelog entries
- remove unnecessary checkout in scheduled-release workflow
- rename build ID to sonr
- remove unnecessary release existence check
- move dwn wasm build to pkg directory
## v0.3.1 (2024-09-29)
### Refactor
- move nebula/pages to pkg/nebula/pages
## v0.3.0 (2024-09-29)
### Feat
- add buf.lock for proto definitions
### Fix
- remove unused linting rules
- update proto breaking check target to master branch
### Refactor
- remove unused lock files and configurations
## v0.2.0 (2024-09-29)
### Feat
- disable goreleaser workflow
- update workflows to include master branch
- remove global style declaration
- **oracle**: add oracle module
- optimize IPFS configuration for better performance
- add local IPFS bootstrap script and refactor devbox config
- add AllocateVault HTTP endpoint
- add WebAuthn credential management functionality
- remove unused coins interface
- remove global integrity proof from genesis state
- add vault module
- enable buf.build publishing on master and develop branches
- add Gitflow workflow for syncing branches
- add automated production release workflow
- **ui**: implement profile page
- add automated production release workflow
- **did**: remove unused proto files
- add enums.pulsar.go file for PermissionScope enum (#4)
- add initial DID implementation
- remove builder interface
- add basic UI for block explorer
- add Usage: pkl [OPTIONS] COMMAND [ARGS]...
- use SQLite embedded driver
- add DID method for each coin
- Expand KeyType enum and update KeyInfo message in genesis.proto
- Add whitelisted key types to genesis params
- Add DID grants protobuf definition
- Add fields to KeyInfo struct to distinguish CBOR and standard blockchain key types
- Add new message types for AssetInfo, ChainInfo, Endpoint, ExplorerInfo, FeeInfo, and KeyInfo
- run sonr-node container in testnet network and make network external
- Add docker-compose.yaml file to start a Sonr testnet node
- configure Sonr testnet environment
- Update Dockerfile to start and run a testnet
- add Equal methods for AssetInfo and ChainInfo types
- Add ProveWitness and SyncVault RPCs
- Add MsgRegisterService to handle service registration
- Add MsgRegisterService to handle service registration
- add enums.pulsar.go file for PermissionScope enum
### Fix
- ensure go version is up-to-date
- use GITHUB_TOKEN for version bump workflow
- update account table interface to use address, chain and network
- **ci**: update docker vm release workflow with new token
- use mnemonic phrases for test account keys
- reduce motr proxy shutdown timeout
- **nebula**: use bunx for tailwindcss build
- **proto**: update protobuf message index numbers
- **ante**: reduce POA rate floor and ceiling
- Update proc_list_width in mprocs.yaml
- Add service to database when registering
- pin added did documents to local ipfs node
- remove extra spaces in typeUrl
- **release**: remove unnecessary quotes in tag pattern
- remove unused imports and simplify KeyInfo message
- bind node ports to localhost
- Update docker-compose network name to dokploy-network
- Update network name to dokploy
- remove unused port mapping
- Update docker-compose.yaml to use correct volume path
- update docker-compose volume name
- Update docker-compose.yaml to use shell directly for sonrd command
- replace "sh" with "/bin/sh" in docker-compose.yaml command
- Update runner image dependencies for debian-11
- **deps**: update golang image to 1.21
- **chains**: update nomic chain build target
- Remove unused `Meta` message from `genesis.proto`
- Add ProveWitness and SyncVault RPCs
### Refactor
- adjust source directory for config files (#1102)
- Use actions/checkout@v4
- remove unused master branch from CI workflow
- rename github token secret
- remove unnecessary x-cloak styles
- optimize oracle genesis proto
- remove unused code related to whitelisted assets
- update buf publish source directory
- adjust devbox configuration to reflect nebula changes
- rename msg_server.go to rpc.go
- remove devbox integration
- move dwn package to app/config
- move configuration files to app directory
- extract root command creation to separate file
- move ipfs setup to function
- remove unnecessary proxy config
- rename script to
- move DWN proxy server logic to separate file
- use htmx instead of dwn for vault client
- remove unused environment variables
- simplify verification method structure
- use staking keeper in DID keeper
- remove unused dependencies
- remove unused image building workflow
- add field to
- Update KeyKind Enum to have proper naming conventions
- Update `DIDNamespace` to have proper naming convention
- expose ports directly in docker-compose
- remove unused port mappings
- streamline script execution
- use CMD instead of ENTRYPOINT in Dockerfile
- **deps**: Upgrade Debian base image to 11
- Simplify the types and properties to keep a consistent structure for the blockchain
- remove PERMISSION_SCOPE_IDENTIFIERS_ENS enum value
+50 -26
View File
@@ -8,9 +8,14 @@ SDK_PACK := $(shell go list -m github.com/cosmos/cosmos-sdk | sed 's/ /\@/g')
BINDIR ?= $(GOPATH)/bin
SIMAPP = ./app
PC_PORT_NUM=42069
PC_LOG_FILE=./sonr.log
PC_SOCKET_PATH=/tmp/sonr-net.sock
# for dockerized protobuf tools
DOCKER := $(shell which docker)
HTTPS_GIT := github.com/onsonr/sonr.git
PROCESS_COMPOSE := $(shell which process-compose)
export GO111MODULE = on
@@ -115,13 +120,17 @@ clean:
rm -rf .aider*
rm -rf static
rm -rf .out
rm -rf build
rm -rf hway.db
rm -rf snapcraft-local.yaml build/
rm -rf build
distclean: clean
rm -rf vendor/
init-env:
@echo "Installing process-compose"
sh scripts/init_env.sh
########################################
### Testing
@@ -298,51 +307,66 @@ sh-testnet: mod-tidy
###############################################################################
### generation ###
###############################################################################
.PHONY: pkl-gen tailwind-gen templ-gen
.PHONY: gen-pkl gen-templ
pkl-gen:
go install github.com/apple/pkl-go/cmd/pkl-gen-go@latest
pkl-gen-go pkl/sonr.motr/ATN.pkl
pkl-gen-go pkl/sonr.hway/Env.pkl
pkl-gen-go pkl/sonr.motr/DWN.pkl
pkl-gen-go pkl/sonr.hway/ORM.pkl
gen-pkl: init-env
pkl-gen-go pkl/sonr.orm/UCAN.pkl
pkl-gen-go pkl/sonr.orm/Models.pkl
pkl-gen-go pkl/sonr.conf/Hway.pkl
pkl-gen-go pkl/sonr.conf/Motr.pkl
templ-gen:
@go install github.com/a-h/templ/cmd/templ@latest
gen-templ: init-env
templ generate
###############################################################################
### custom builds ###
###############################################################################
.PHONY: motr-build hway-build hway-serve
.PHONY: build-motr build-hway logs-hway logs-sonr
motr-build:
build-motr:
GOOS=js GOARCH=wasm go build -o static/wasm/app.wasm ./cmd/motr/main.go
hway-build: templ-gen
go build -o build/hway ./cmd/hway/main.go
build-hway: gen-templ
go build -o build/hway ./cmd/hway
hway-serve: hway-build
./build/hway
logs-hway: init-env
bin/process-compose process logs hway --port $(PC_PORT_NUM) --follow
logs-sonr: init-env
bin/process-compose process logs sonr --port $(PC_PORT_NUM) --follow
###############################################################################
### Network Start/Stop ###
###############################################################################
.PHONY: deploy start start-tui start-uds stop stop-uds restart status
start: build-hway init-env
bin/process-compose up --port $(PC_PORT_NUM) --log-file $(PC_LOG_FILE) --detached -f deploy/process-compose.yaml
start-tui: build-hway init-env
bin/process-compose up --port $(PC_PORT_NUM) --log-file $(PC_LOG_FILE) -f deploy/process-compose.yaml
start-uds: build-hway init-env
bin/process-compose up --use-uds --unix-socket $(PC_SOCKET_PATH) --log-file $(PC_LOG_FILE) --detached -f deploy/process-compose.yaml
stop: init-env
bin/process-compose down --port $(PC_PORT_NUM)
stop-uds: init-env
bin/process-compose down --use-uds --unix-socket $(PC_SOCKET_PATH)
status: init-env
bin/process-compose project state --port $(PC_PORT_NUM)
###############################################################################
### help ###
###############################################################################
.PHONY: deploy-buf deploy-pkl
deploy-buf:
deploy:
cd ./proto && bunx buf dep update && bunx buf build && bunx buf push
deploy-pkl:
sh ./.github/scripts/upload_cdn.sh
###############################################################################
### help ###
###############################################################################
help:
@echo "Usage: make <target>"
@echo ""
+1
View File
@@ -6,6 +6,7 @@
[![Static Badge](https://img.shields.io/badge/homepage-sonr.io-blue?style=flat-square)](https://sonr.io)
[![Go Report Card](https://goreportcard.com/badge/github.com/onsonr/sonr)](https://goreportcard.com/report/github.com/onsonr/sonr)
[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=sonrhq_sonr&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=sonr-io_sonr)
[![Latest version of 'sonrd' @ Cloudsmith](https://api-prd.cloudsmith.io/v1/badges/version/sonr/sonr/deb/sonrd/latest/a=amd64;xc=main;d=ubuntu%252Fxenial;t=binary/?render=true&show_latest=true)](https://cloudsmith.io/~sonr/repos/sonr/packages/detail/deb/sonrd/latest/a=amd64;xc=main;d=ubuntu%252Fxenial;t=binary/)
> Sonr is a combination of decentralized primitives. Fundamentally, it is a peer-to-peer identity and asset management system that leverages DID documents, Webauthn, and IPFS—providing users with a secure, portable decentralized identity.
+99
View File
@@ -0,0 +1,99 @@
package main
import (
"fmt"
"log"
"net/http"
"os"
"github.com/labstack/echo/v4"
"github.com/labstack/echo/v4/middleware"
"github.com/onsonr/sonr/crypto/ucan"
"github.com/onsonr/sonr/internal/gateway"
"github.com/onsonr/sonr/pkg/common/ipfs"
config "github.com/onsonr/sonr/pkg/config/hway"
"github.com/onsonr/sonr/pkg/database/sessions"
"github.com/onsonr/sonr/pkg/didauth/producer"
"github.com/spf13/cobra"
)
// Command line flags
var (
servePort int // Gateway http entry point (default 3000)
configDir string // Hway config directory (default hway)
sqliteFile string // SQLite database file (default hway.db)
chainID string // Current chain ID (default sonr-testnet-1)
ipfsGatewayURL string // IPFS gateway URL (default localhost:8080)
sonrAPIURL string // Sonr API URL (default localhost:1317)
sonrGrpcURL string // Sonr gRPC URL (default localhost:9090)
sonrRPCURL string // Sonr RPC URL (default localhost:26657)
)
func rootCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "hway",
Short: "Sonr DID gateway",
Run: func(cmd *cobra.Command, args []string) {
env, err := loadEnvImplFromArgs(args)
if err != nil {
panic(err)
}
e, err := setupServer(env)
if err != nil {
panic(err)
}
if err := e.Start(fmt.Sprintf(":%d", env.GetServePort())); err != http.ErrServerClosed {
log.Fatal(err)
os.Exit(1)
return
}
},
}
cmd.Flags().IntVar(&servePort, "serve-port", 3000, "Port to serve the gateway on")
cmd.Flags().StringVar(&configDir, "config-dir", "hway", "Directory to store config files")
cmd.Flags().StringVar(&sqliteFile, "sqlite-file", "hway.db", "File to store sqlite database")
cmd.Flags().StringVar(&chainID, "chain-id", "sonr-testnet-1", "Chain ID")
cmd.Flags().StringVar(&ipfsGatewayURL, "ipfs-gateway-url", "localhost:8080", "IPFS gateway URL")
cmd.Flags().StringVar(&sonrAPIURL, "sonr-api-url", "localhost:1317", "Sonr API URL")
cmd.Flags().StringVar(&sonrGrpcURL, "sonr-grpc-url", "localhost:9090", "Sonr gRPC URL")
cmd.Flags().StringVar(&sonrRPCURL, "sonr-rpc-url", "localhost:26657", "Sonr RPC URL")
return cmd
}
func loadEnvImplFromArgs(args []string) (config.Hway, error) {
cmd := rootCmd()
if err := cmd.ParseFlags(args); err != nil {
return nil, err
}
env := &config.HwayImpl{
ServePort: servePort,
ConfigDir: configDir,
SqliteFile: sqliteFile,
ChainId: chainID,
IpfsGatewayUrl: ipfsGatewayURL,
SonrApiUrl: sonrAPIURL,
SonrGrpcUrl: sonrGrpcURL,
SonrRpcUrl: sonrRPCURL,
}
return env, nil
}
// setupServer sets up the server
func setupServer(env config.Hway) (*echo.Echo, error) {
ipc, err := ipfs.NewClient()
if err != nil {
return nil, err
}
db, err := sessions.NewGormDB(env)
if err != nil {
return nil, err
}
e := echo.New()
e.IPExtractor = echo.ExtractIPDirect()
e.Use(middleware.Logger())
e.Use(middleware.Recover())
e.Use(producer.Middleware(ipc, ucan.ServicePermissions))
gateway.RegisterRoutes(e, env, db)
return e, nil
}
-1
View File
@@ -1 +0,0 @@
amends "https://pkl.sh/sonr.hway/0.0.3/Env.pkl"
+4 -45
View File
@@ -3,56 +3,15 @@ package main
import (
_ "embed"
"fmt"
"log"
"net/http"
"os"
"github.com/labstack/echo/v4"
"github.com/labstack/echo/v4/middleware"
"github.com/onsonr/sonr/crypto/ucan"
"github.com/onsonr/sonr/pkg/common/ipfs"
"github.com/onsonr/sonr/pkg/common/producer"
"github.com/onsonr/sonr/pkg/gateway"
"github.com/onsonr/sonr/pkg/gateway/config"
)
//go:embed config.pkl
var configBz []byte
func loadConfig() (config.Env, error) {
return config.LoadFromBytes(configBz)
}
// setupServer sets up the server
func setupServer(env config.Env) (*echo.Echo, error) {
ipc, err := ipfs.NewClient()
if err != nil {
return nil, err
}
e := echo.New()
e.IPExtractor = echo.ExtractIPDirect()
e.Use(middleware.Logger())
e.Use(middleware.Recover())
e.Use(producer.Middleware(ipc, ucan.ServicePermissions))
gateway.RegisterRoutes(e, env)
return e, nil
}
// main is the entry point for the application
func main() {
env, err := loadConfig()
if err != nil {
panic(err)
}
e, err := setupServer(env)
if err != nil {
panic(err)
}
if err := e.Start(fmt.Sprintf(":%d", env.GetServePort())); err != http.ErrServerClosed {
log.Fatal(err)
cmd := rootCmd()
if err := cmd.Execute(); err != nil {
fmt.Println(err)
os.Exit(1)
return
}
os.Exit(0)
}
+8 -8
View File
@@ -8,15 +8,15 @@ import (
"syscall/js"
"github.com/labstack/echo/v4"
"github.com/onsonr/sonr/cmd/motr/internal"
"github.com/onsonr/sonr/pkg/common/controller"
"github.com/onsonr/sonr/pkg/vault"
"github.com/onsonr/sonr/pkg/vault/types"
"github.com/onsonr/sonr/internal/vault"
"github.com/onsonr/sonr/pkg/common/wasm"
"github.com/onsonr/sonr/pkg/config/motr"
"github.com/onsonr/sonr/pkg/didauth/controller"
)
var (
env *types.Environment
config *types.Config
env *motr.Environment
config *motr.Config
err error
)
@@ -48,8 +48,8 @@ func main() {
js.Global().Set("processConfig", js.FuncOf(processConfig))
e := echo.New()
e.Use(internal.WasmContextMiddleware)
e.Use(wasm.ContextMiddleware)
e.Use(controller.Middleware(nil))
vault.RegisterRoutes(e, config)
internal.ServeFetch(e)
wasm.ServeFetch(e)
}
-84
View File
@@ -1,14 +1,9 @@
package mpc
import (
genericecdsa "crypto/ecdsa"
"fmt"
"math/big"
"github.com/cosmos/cosmos-sdk/types/bech32"
"github.com/onsonr/sonr/crypto/core/curves"
"github.com/onsonr/sonr/crypto/core/protocol"
"golang.org/x/crypto/sha3"
)
type (
@@ -64,82 +59,3 @@ func ComputeSonrAddr(pk []byte) (string, error) {
}
return sonrAddr, nil
}
// For DKG bob starts first. For refresh and sign, Alice starts first.
func RunProtocol(firstParty protocol.Iterator, secondParty protocol.Iterator) (error, error) {
var (
message *protocol.Message
aErr error
bErr error
)
for aErr != protocol.ErrProtocolFinished || bErr != protocol.ErrProtocolFinished {
// Crank each protocol forward one iteration
message, bErr = firstParty.Next(message)
if bErr != nil && bErr != protocol.ErrProtocolFinished {
return nil, bErr
}
message, aErr = secondParty.Next(message)
if aErr != nil && aErr != protocol.ErrProtocolFinished {
return aErr, nil
}
}
return aErr, bErr
}
// ComputeEcPoint builds an elliptic curve point from a compressed byte slice
func ComputeEcPoint(pubKey []byte) (*curves.EcPoint, error) {
crv := curves.K256()
x := new(big.Int).SetBytes(pubKey[1:33])
y := new(big.Int).SetBytes(pubKey[33:])
ecCurve, err := crv.ToEllipticCurve()
if err != nil {
return nil, fmt.Errorf("error converting curve: %v", err)
}
return &curves.EcPoint{X: x, Y: y, Curve: ecCurve}, nil
}
func ComputeEcdsaPublicKey(pubKey []byte) (*genericecdsa.PublicKey, error) {
pk, err := ComputeEcPoint(pubKey)
if err != nil {
return nil, err
}
return &genericecdsa.PublicKey{
Curve: pk.Curve,
X: pk.X,
Y: pk.Y,
}, nil
}
// VerifySignature verifies the signature of a message
func VerifySignature(pk []byte, msg []byte, sig []byte) (bool, error) {
pp, err := ComputeEcPoint(pk)
if err != nil {
return false, err
}
sigEd, err := DeserializeSignature(sig)
if err != nil {
return false, err
}
hash := sha3.New256()
_, err = hash.Write(msg)
if err != nil {
return false, err
}
digest := hash.Sum(nil)
return curves.VerifyEcdsa(pp, digest[:], sigEd), nil
}
func checkIteratedErrors(aErr, bErr error) error {
if aErr == protocol.ErrProtocolFinished && bErr == protocol.ErrProtocolFinished {
return nil
}
if aErr != protocol.ErrProtocolFinished {
return aErr
}
if bErr != protocol.ErrProtocolFinished {
return bErr
}
return nil
}
+82
View File
@@ -2,12 +2,15 @@ package mpc
import (
"crypto/ecdsa"
genericecdsa "crypto/ecdsa"
"errors"
"fmt"
"math/big"
"github.com/onsonr/sonr/crypto/core/curves"
"github.com/onsonr/sonr/crypto/core/protocol"
"github.com/onsonr/sonr/crypto/tecdsa/dklsv1"
"golang.org/x/crypto/sha3"
)
// NewKeyshareSource generates a new MPC keyshare
@@ -113,3 +116,82 @@ func DeserializeSignature(sigBytes []byte) (Signature, error) {
func VerifyMPCSignature(sig Signature, msg []byte, publicKey *ecdsa.PublicKey) bool {
return ecdsa.Verify(publicKey, msg, sig.R, sig.S)
}
// For DKG bob starts first. For refresh and sign, Alice starts first.
func RunProtocol(firstParty protocol.Iterator, secondParty protocol.Iterator) (error, error) {
var (
message *protocol.Message
aErr error
bErr error
)
for aErr != protocol.ErrProtocolFinished || bErr != protocol.ErrProtocolFinished {
// Crank each protocol forward one iteration
message, bErr = firstParty.Next(message)
if bErr != nil && bErr != protocol.ErrProtocolFinished {
return nil, bErr
}
message, aErr = secondParty.Next(message)
if aErr != nil && aErr != protocol.ErrProtocolFinished {
return aErr, nil
}
}
return aErr, bErr
}
// ComputeEcPoint builds an elliptic curve point from a compressed byte slice
func ComputeEcPoint(pubKey []byte) (*curves.EcPoint, error) {
crv := curves.K256()
x := new(big.Int).SetBytes(pubKey[1:33])
y := new(big.Int).SetBytes(pubKey[33:])
ecCurve, err := crv.ToEllipticCurve()
if err != nil {
return nil, fmt.Errorf("error converting curve: %v", err)
}
return &curves.EcPoint{X: x, Y: y, Curve: ecCurve}, nil
}
func ComputeEcdsaPublicKey(pubKey []byte) (*genericecdsa.PublicKey, error) {
pk, err := ComputeEcPoint(pubKey)
if err != nil {
return nil, err
}
return &genericecdsa.PublicKey{
Curve: pk.Curve,
X: pk.X,
Y: pk.Y,
}, nil
}
// VerifySignature verifies the signature of a message
func VerifySignature(pk []byte, msg []byte, sig []byte) (bool, error) {
pp, err := ComputeEcPoint(pk)
if err != nil {
return false, err
}
sigEd, err := DeserializeSignature(sig)
if err != nil {
return false, err
}
hash := sha3.New256()
_, err = hash.Write(msg)
if err != nil {
return false, err
}
digest := hash.Sum(nil)
return curves.VerifyEcdsa(pp, digest[:], sigEd), nil
}
func checkIteratedErrors(aErr, bErr error) error {
if aErr == protocol.ErrProtocolFinished && bErr == protocol.ErrProtocolFinished {
return nil
}
if aErr != protocol.ErrProtocolFinished {
return aErr
}
if bErr != protocol.ErrProtocolFinished {
return bErr
}
return nil
}
@@ -1,4 +1,4 @@
// Code generated from Pkl module `sonr.motr.ATN`. DO NOT EDIT.
// Code generated from Pkl module `sonr.orm.UCAN`. DO NOT EDIT.
package attns
import (
@@ -7,11 +7,11 @@ import (
"github.com/apple/pkl-go/pkl"
)
type ATN struct {
type UCAN struct {
}
// LoadFromPath loads the pkl module at the given path and evaluates it into a ATN
func LoadFromPath(ctx context.Context, path string) (ret *ATN, err error) {
// LoadFromPath loads the pkl module at the given path and evaluates it into a UCAN
func LoadFromPath(ctx context.Context, path string) (ret *UCAN, err error) {
evaluator, err := pkl.NewEvaluator(ctx, pkl.PreconfiguredOptions)
if err != nil {
return nil, err
@@ -26,9 +26,9 @@ func LoadFromPath(ctx context.Context, path string) (ret *ATN, err error) {
return ret, err
}
// Load loads the pkl module at the given source and evaluates it with the given evaluator into a ATN
func Load(ctx context.Context, evaluator pkl.Evaluator, source *pkl.ModuleSource) (*ATN, error) {
var ret ATN
// Load loads the pkl module at the given source and evaluates it with the given evaluator into a UCAN
func Load(ctx context.Context, evaluator pkl.Evaluator, source *pkl.ModuleSource) (*UCAN, error) {
var ret UCAN
if err := evaluator.EvaluateModule(ctx, source, &ret); err != nil {
return nil, err
}
@@ -1,4 +1,4 @@
// Code generated from Pkl module `sonr.motr.ATN`. DO NOT EDIT.
// Code generated from Pkl module `sonr.orm.UCAN`. DO NOT EDIT.
package capability
import (
+2 -2
View File
@@ -1,8 +1,8 @@
// Code generated from Pkl module `sonr.motr.ATN`. DO NOT EDIT.
// Code generated from Pkl module `sonr.orm.UCAN`. DO NOT EDIT.
package attns
import "github.com/apple/pkl-go/pkl"
func init() {
pkl.RegisterMapping("sonr.motr.ATN", ATN{})
pkl.RegisterMapping("sonr.orm.UCAN", UCAN{})
}
@@ -1,4 +1,4 @@
// Code generated from Pkl module `sonr.motr.ATN`. DO NOT EDIT.
// Code generated from Pkl module `sonr.orm.UCAN`. DO NOT EDIT.
package policytype
import (
@@ -1,4 +1,4 @@
// Code generated from Pkl module `sonr.motr.ATN`. DO NOT EDIT.
// Code generated from Pkl module `sonr.orm.UCAN`. DO NOT EDIT.
package resourcetype
import (
-55
View File
@@ -1,55 +0,0 @@
# https://taskfile.dev
version: "3"
vars:
GREETING: Hello, World!
tasks:
init:sonrd:
cmds:
- sonrd init {{.NODE_NAME}} --chain-id {{.CHAIN_ID}} --home {{.HOME}}
init:ipfs:
cmds:
- ipfs init
init:hway:
cmds:
- sonrd hway init {{.NODE_NAME}} --home {{.HOME}}
start:sonrd:
cmds:
- sonrd start --home {{.HOME}}
start:ipfs:
cmds:
- ipfs daemon
start:hway:
cmds:
- sonrd hway start --home {{.HOME}}
stop:sonrd:
cmds:
- sonrd stop
stop:ipfs:
cmds:
- ipfs daemon stop
stop:hway:
cmds:
- sonrd hway stop
clean:sonrd:
cmds:
- rm -rf {{.HOME}}
clean:ipfs:
cmds:
- rm -rf ~/.ipfs
clean:hway:
cmds:
- rm -rf {{.HOME}}/data/hway
-251
View File
@@ -1,251 +0,0 @@
{
"lockfile_version": "1",
"packages": {
"air@latest": {
"last_modified": "2024-11-16T04:25:12Z",
"resolved": "github:NixOS/nixpkgs/34a626458d686f1b58139620a8b2793e9e123bba#air",
"source": "devbox-search",
"version": "1.61.1",
"systems": {
"aarch64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/0s90vbnmsyyixs0991md21pbrw8babfb-air-1.61.1",
"default": true
}
],
"store_path": "/nix/store/0s90vbnmsyyixs0991md21pbrw8babfb-air-1.61.1"
},
"aarch64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/8mpw2asxs297v26fxqy2y1bq438f344l-air-1.61.1",
"default": true
}
],
"store_path": "/nix/store/8mpw2asxs297v26fxqy2y1bq438f344l-air-1.61.1"
},
"x86_64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/abminkf7ldqf9vm14xx5wvsrdx3wrvy6-air-1.61.1",
"default": true
}
],
"store_path": "/nix/store/abminkf7ldqf9vm14xx5wvsrdx3wrvy6-air-1.61.1"
},
"x86_64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/ajx8v5rbbvglncb97yybg3x9kn95gfrm-air-1.61.1",
"default": true
}
],
"store_path": "/nix/store/ajx8v5rbbvglncb97yybg3x9kn95gfrm-air-1.61.1"
}
}
},
"bun@latest": {
"last_modified": "2024-11-18T00:41:09Z",
"resolved": "github:NixOS/nixpkgs/5083ec887760adfe12af64830a66807423a859a7#bun",
"source": "devbox-search",
"version": "1.1.34",
"systems": {
"aarch64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/xnj00gq1mfffvgyisghk4m9f38gc5c5c-bun-1.1.34",
"default": true
}
],
"store_path": "/nix/store/xnj00gq1mfffvgyisghk4m9f38gc5c5c-bun-1.1.34"
},
"aarch64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/kccpzv8fb7swmmxbhv805qzq242rhy33-bun-1.1.34",
"default": true
}
],
"store_path": "/nix/store/kccpzv8fb7swmmxbhv805qzq242rhy33-bun-1.1.34"
},
"x86_64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/8h5k3l4fpgs3al2wvna7x9ybyyc8k36d-bun-1.1.34",
"default": true
}
],
"store_path": "/nix/store/8h5k3l4fpgs3al2wvna7x9ybyyc8k36d-bun-1.1.34"
},
"x86_64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/x089g4srqw71w5jnc87vxbh7m12498i0-bun-1.1.34",
"default": true
}
],
"store_path": "/nix/store/x089g4srqw71w5jnc87vxbh7m12498i0-bun-1.1.34"
}
}
},
"ipfs@latest": {
"last_modified": "2023-02-24T09:01:09Z",
"resolved": "github:NixOS/nixpkgs/7d0ed7f2e5aea07ab22ccb338d27fbe347ed2f11#ipfs",
"source": "devbox-search",
"version": "0.17.0"
},
"skate@latest": {
"last_modified": "2024-11-16T04:25:12Z",
"resolved": "github:NixOS/nixpkgs/34a626458d686f1b58139620a8b2793e9e123bba#skate",
"source": "devbox-search",
"version": "1.0.0",
"systems": {
"aarch64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/q6yhpyfbqiabyic6ymx5rp2db62bnbvr-skate-1.0.0",
"default": true
}
],
"store_path": "/nix/store/q6yhpyfbqiabyic6ymx5rp2db62bnbvr-skate-1.0.0"
},
"aarch64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/q55dbgvc4xwvr2g02dks6j2j699qni2k-skate-1.0.0",
"default": true
}
],
"store_path": "/nix/store/q55dbgvc4xwvr2g02dks6j2j699qni2k-skate-1.0.0"
},
"x86_64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/s1hy525y8ciya3nrns9kryy3jlcw8igv-skate-1.0.0",
"default": true
}
],
"store_path": "/nix/store/s1hy525y8ciya3nrns9kryy3jlcw8igv-skate-1.0.0"
},
"x86_64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/8s03iazymz77nv6pjxpz7wair0m646wv-skate-1.0.0",
"default": true
}
],
"store_path": "/nix/store/8s03iazymz77nv6pjxpz7wair0m646wv-skate-1.0.0"
}
}
},
"templ@latest": {
"last_modified": "2024-11-16T04:25:12Z",
"resolved": "github:NixOS/nixpkgs/34a626458d686f1b58139620a8b2793e9e123bba#templ",
"source": "devbox-search",
"version": "0.2.793",
"systems": {
"aarch64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/ivargvf76g71k5gk3iz4al52rsy28w38-templ-0.2.793",
"default": true
}
],
"store_path": "/nix/store/ivargvf76g71k5gk3iz4al52rsy28w38-templ-0.2.793"
},
"aarch64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/03654iddn006yx5j1lqq496hax60v8p5-templ-0.2.793",
"default": true
}
],
"store_path": "/nix/store/03654iddn006yx5j1lqq496hax60v8p5-templ-0.2.793"
},
"x86_64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/blvd5wbd1ix6m745s4zx3b84kwzprshq-templ-0.2.793",
"default": true
}
],
"store_path": "/nix/store/blvd5wbd1ix6m745s4zx3b84kwzprshq-templ-0.2.793"
},
"x86_64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/sn5h79d36r86i6a8rm1k52c2ij1s32kx-templ-0.2.793",
"default": true
}
],
"store_path": "/nix/store/sn5h79d36r86i6a8rm1k52c2ij1s32kx-templ-0.2.793"
}
}
},
"tigerbeetle@latest": {
"last_modified": "2024-11-16T04:25:12Z",
"resolved": "github:NixOS/nixpkgs/34a626458d686f1b58139620a8b2793e9e123bba#tigerbeetle",
"source": "devbox-search",
"version": "0.16.12",
"systems": {
"aarch64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/mm3jzwf24p35afr55v7kl5a0h6962i6p-tigerbeetle-0.16.12",
"default": true
}
],
"store_path": "/nix/store/mm3jzwf24p35afr55v7kl5a0h6962i6p-tigerbeetle-0.16.12"
},
"aarch64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/4106973gg3crfxq0gwrgwn4hcx64mzyy-tigerbeetle-0.16.12",
"default": true
}
],
"store_path": "/nix/store/4106973gg3crfxq0gwrgwn4hcx64mzyy-tigerbeetle-0.16.12"
},
"x86_64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/6lnwnr3mvdamm5lxjjqkaagw2pyqlq0a-tigerbeetle-0.16.12",
"default": true
}
],
"store_path": "/nix/store/6lnwnr3mvdamm5lxjjqkaagw2pyqlq0a-tigerbeetle-0.16.12"
},
"x86_64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/afrj2ph61xz0lh7f3d1g1d7v2rslbvny-tigerbeetle-0.16.12",
"default": true
}
],
"store_path": "/nix/store/afrj2ph61xz0lh7f3d1g1d7v2rslbvny-tigerbeetle-0.16.12"
}
}
}
}
}
@@ -3,16 +3,10 @@ version: "0.6"
processes:
sonr:
namespace: devnet
background: true
command: "make sh-testnet"
restart: never
max_restarts: 1
hway:
namespace: devnet
background: true
command: "./build/hway"
restart: never
max_restarts: 1
depends:
- sonr
-202
View File
@@ -1,202 +0,0 @@
import "https://pkl.sh/ipfs.net/0.0.1/Config.pkl"
API {
HTTPHeaders {
`Access-Control-Allow-Origin` = new { "*" }
}
}
Addresses {
API = "/ip4/127.0.0.1/tcp/5001"
Gateway = "/ip4/127.0.0.1/tcp/8080"
Swarm = new {
"/ip4/0.0.0.0/tcp/4001"
"/ip6/::/tcp/4001"
"/ip4/0.0.0.0/udp/4001/quic"
"/ip6/::/udp/4001/quic"
}
}
Bootstrap {
"/dnsaddr/bootstrap.libp2p.io/p2p/QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19uLTa"
"/dnsaddr/bootstrap.libp2p.io/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb"
"/dnsaddr/bootstrap.libp2p.io/p2p/QmcZf59bWwK5XFi76CZX8cbJ4BhTzzA3gU1ZjYZcYW3dwt"
"/ip4/104.131.131.82/tcp/4001/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ"
"/ip4/104.131.131.82/udp/4001/quic/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ"
"/dnsaddr/bootstrap.libp2p.io/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN"
}
Datastore {
BloomFilterSize = 0
GCPeriod = "1h"
HashOnRead = false
StorageGCWatermark = 90
StorageMax = "10GB"
Spec = new {
mounts = new {
new {
prefix = "flatfs.datastore"
child = new {
path = "blocks"
shardFunc = "/repo/flatfs/shard/v1/next-to-last/2"
type = "flatfs"
sync = true
}
mountpoint = "/blocks"
type = "measure"
}
new {
prefix = "leveldb.datastore"
child = new {
compression = "none"
path = "datastore"
type = "levelds"
}
mountpoint = "/"
type = "measure"
}
}
type = "mount"
}
}
Discovery {
MDNS = new {
Enabled = true
}
}
Experimental {
StrategicProviding = false
UrlstoreEnabled = false
AcceleratedDHTClient = false
GraphsyncEnabled = false
FilestoreEnabled = false
Libp2pStreamMounting = false
P2pHttpProxy = false
}
Gateway {
HTTPHeaders = new {
`Access-Control-Allow-Headers` = new {
"X-Requested-With"
"Range"
"User-Agent"
}
`Access-Control-Allow-Methods` = new { "GET" }
`Access-Control-Allow-Origin` = new { "*" }
}
NoDNSLink = false
NoFetch = false
PublicGateways = null
RootRedirect = ""
Writable = false
}
Identity {
PrivKey = "CAESQP0FRhYf5Nvxg0wrbN+VTK7kWdgy+3AKoxU3vNH0K9FHVpXyx6/mHKyCaPjqI11YsHUW0B2ZODGROPafyS6IeWY="
PeerID = "12D3KooWFeMr1tHFs8WAF11rKDULJbmKg9rE5aVhYJU23oC7pqjB"
}
Ipns {
RecordLifetime = ""
RepublishPeriod = ""
ResolveCacheSize = 128
}
Migration {
Keep = ""
}
Mounts {
IPNS = "/ipns"
FuseAllowOther = false
IPFS = "/ipfs"
}
Peering {
Peers = new {
new {
Addrs = new { "/dnsaddr/node-1.ingress.cloudflare-ipfs.com" }
ID = "QmcFf2FH3CEgTNHeMRGhN7HNHU1EXAxoEk6EFuSyXCsvRE"
}
new {
Addrs = new { "/dnsaddr/node-2.ingress.cloudflare-ipfs.com" }
ID = "QmcFmLd5ySfk2WZuJ1mfSWLDjdmHZq7rSAua4GoeSQfs1z"
}
new {
Addrs = new { "/dnsaddr/node-3.ingress.cloudflare-ipfs.com" }
ID = "QmcfFmzSDVbwexQ9Au2pt5YEXHK5xajwgaU6PpkbLWerMa"
}
new {
Addrs = new { "/dnsaddr/node-4.ingress.cloudflare-ipfs.com" }
ID = "QmcfJeB3Js1FG7T8YaZATEiaHqNKVdQfybYYkbT1knUswx"
}
new {
Addrs = new { "/dnsaddr/node-5.ingress.cloudflare-ipfs.com" }
ID = "QmcfVvzK4tMdFmpJjEKDUoqRgP4W9FnmJoziYX5GXJJ8eZ"
}
new {
Addrs = new { "/dnsaddr/node-6.ingress.cloudflare-ipfs.com" }
ID = "QmcfZD3VKrUxyP9BbyUnZDpbqDnT7cQ4WjPP8TRLXaoE7G"
}
new {
Addrs = new { "/dnsaddr/node-7.ingress.cloudflare-ipfs.com" }
ID = "QmcfZP2LuW4jxviTeG8fi28qjnZScACb8PEgHAc17ZEri3"
}
new {
Addrs = new { "/dnsaddr/node-8.ingress.cloudflare-ipfs.com" }
ID = "QmcfgsJsMtx6qJb74akCw1M24X1zFwgGo11h1cuhwQjtJP"
}
new {
Addrs = new { "/dnsaddr/node-9.ingress.cloudflare-ipfs.com" }
ID = "Qmcfr2FC7pFzJbTSDfYaSy1J8Uuy8ccGLeLyqJCKJvTHMi"
}
new {
Addrs = new { "/dnsaddr/node-10.ingress.cloudflare-ipfs.com" }
ID = "QmcfR3V5YAtHBzxVACWCzXTt26SyEkxdwhGJ6875A8BuWx"
}
new {
Addrs = new { "/dnsaddr/node-11.ingress.cloudflare-ipfs.com" }
ID = "Qmcfuo1TM9uUiJp6dTbm915Rf1aTqm3a3dnmCdDQLHgvL5"
}
new {
Addrs = new { "/dnsaddr/node-12.ingress.cloudflare-ipfs.com" }
ID = "QmcfV2sg9zaq7UUHVCGuSvT2M2rnLBAPsiE79vVyK3Cuev"
}
}
}
Provider {
Strategy = ""
}
Pubsub {
Router = ""
DisableSigning = false
}
Reprovider {
Strategy = "all"
Interval = "12h"
}
Routing {
Methods = null
Routers = null
Type = "dht"
}
Swarm {
AddrFilters = null
ConnMgr = new {}
DisableBandwidthMetrics = false
DisableNatPortMap = false
RelayClient = new {}
ResourceMgr = new {}
Transports = new {
Multiplexers = new {}
Network = new {}
Security = new {}
}
}
-3
View File
@@ -1,3 +0,0 @@
amends "https://pkl.sh/sonr.chain/0.0.2/App.pkl"
-3
View File
@@ -1,3 +0,0 @@
amends "https://pkl.sh/sonr.chain/0.0.2/Genesis.pkl"
-404
View File
@@ -1,404 +0,0 @@
{
"lockfile_version": "1",
"packages": {
"bun@latest": {
"last_modified": "2024-11-18T00:41:09Z",
"resolved": "github:NixOS/nixpkgs/5083ec887760adfe12af64830a66807423a859a7#bun",
"source": "devbox-search",
"version": "1.1.34",
"systems": {
"aarch64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/xnj00gq1mfffvgyisghk4m9f38gc5c5c-bun-1.1.34",
"default": true
}
],
"store_path": "/nix/store/xnj00gq1mfffvgyisghk4m9f38gc5c5c-bun-1.1.34"
},
"aarch64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/kccpzv8fb7swmmxbhv805qzq242rhy33-bun-1.1.34",
"default": true
}
],
"store_path": "/nix/store/kccpzv8fb7swmmxbhv805qzq242rhy33-bun-1.1.34"
},
"x86_64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/8h5k3l4fpgs3al2wvna7x9ybyyc8k36d-bun-1.1.34",
"default": true
}
],
"store_path": "/nix/store/8h5k3l4fpgs3al2wvna7x9ybyyc8k36d-bun-1.1.34"
},
"x86_64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/x089g4srqw71w5jnc87vxbh7m12498i0-bun-1.1.34",
"default": true
}
],
"store_path": "/nix/store/x089g4srqw71w5jnc87vxbh7m12498i0-bun-1.1.34"
}
}
},
"cloudflared@latest": {
"last_modified": "2024-11-18T00:41:09Z",
"resolved": "github:NixOS/nixpkgs/5083ec887760adfe12af64830a66807423a859a7#cloudflared",
"source": "devbox-search",
"version": "2024.11.0",
"systems": {
"aarch64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/95knk04xlh78swlk9a6kg524rfykzzmz-cloudflared-2024.11.0",
"default": true
}
],
"store_path": "/nix/store/95knk04xlh78swlk9a6kg524rfykzzmz-cloudflared-2024.11.0"
},
"aarch64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/2d6mh1pi99m19bc9m3phcsfgygbfpyig-cloudflared-2024.11.0",
"default": true
}
],
"store_path": "/nix/store/2d6mh1pi99m19bc9m3phcsfgygbfpyig-cloudflared-2024.11.0"
},
"x86_64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/4dii539ldfv0f9n7xigfy19ivrg3ng2n-cloudflared-2024.11.0",
"default": true
}
],
"store_path": "/nix/store/4dii539ldfv0f9n7xigfy19ivrg3ng2n-cloudflared-2024.11.0"
},
"x86_64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/hlnabpfi58mpd16symqb7kp8xc2lf1pf-cloudflared-2024.11.0",
"default": true
}
],
"store_path": "/nix/store/hlnabpfi58mpd16symqb7kp8xc2lf1pf-cloudflared-2024.11.0"
}
}
},
"go@1.23": {
"last_modified": "2024-11-16T04:25:12Z",
"resolved": "github:NixOS/nixpkgs/34a626458d686f1b58139620a8b2793e9e123bba#go",
"source": "devbox-search",
"version": "1.23.3",
"systems": {
"aarch64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/qrj2wp6vzfpjfrrlcmr22818zg83fb73-go-1.23.3",
"default": true
}
],
"store_path": "/nix/store/qrj2wp6vzfpjfrrlcmr22818zg83fb73-go-1.23.3"
},
"aarch64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/dm66qyl19skrwcmk4rb9xcs64xc1d071-go-1.23.3",
"default": true
}
],
"store_path": "/nix/store/dm66qyl19skrwcmk4rb9xcs64xc1d071-go-1.23.3"
},
"x86_64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/vkjn6njpz4gy5ma763vh8hh93bgjwycr-go-1.23.3",
"default": true
}
],
"store_path": "/nix/store/vkjn6njpz4gy5ma763vh8hh93bgjwycr-go-1.23.3"
},
"x86_64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/bavnchxi7v6xs077jxv7fl5rrqc3y87w-go-1.23.3",
"default": true
}
],
"store_path": "/nix/store/bavnchxi7v6xs077jxv7fl5rrqc3y87w-go-1.23.3"
}
}
},
"ipfs@latest": {
"last_modified": "2023-02-24T09:01:09Z",
"resolved": "github:NixOS/nixpkgs/7d0ed7f2e5aea07ab22ccb338d27fbe347ed2f11#ipfs",
"source": "devbox-search",
"version": "0.17.0"
},
"matrix-synapse@latest": {
"last_modified": "2024-11-18T00:41:09Z",
"resolved": "github:NixOS/nixpkgs/5083ec887760adfe12af64830a66807423a859a7#matrix-synapse",
"source": "devbox-search",
"version": "1.119.0",
"systems": {
"aarch64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/dfgj6lgmxy18qd5v9z91376i0b1z06jx-matrix-synapse-wrapped-1.119.0",
"default": true
}
],
"store_path": "/nix/store/dfgj6lgmxy18qd5v9z91376i0b1z06jx-matrix-synapse-wrapped-1.119.0"
},
"x86_64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/570l35c4n3qdxaszrf6bz4rrrw87pkil-matrix-synapse-wrapped-1.119.0",
"default": true
}
],
"store_path": "/nix/store/570l35c4n3qdxaszrf6bz4rrrw87pkil-matrix-synapse-wrapped-1.119.0"
}
}
},
"postgresql@latest": {
"last_modified": "2024-11-22T01:27:12Z",
"plugin_version": "0.0.2",
"resolved": "github:NixOS/nixpkgs/8edf06bea5bcbee082df1b7369ff973b91618b8d#postgresql",
"source": "devbox-search",
"version": "16.4",
"systems": {
"aarch64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/j6n9b877yhrnkp9z9p1gllxpnfvdrbrb-postgresql-16.4",
"default": true
},
{
"name": "man",
"path": "/nix/store/465icqyw6m38jxpx5yr1ri26ki0f96sz-postgresql-16.4-man",
"default": true
},
{
"name": "lib",
"path": "/nix/store/l9w6d22hrcrxkv005g2gbzhvk64vp4rm-postgresql-16.4-lib"
},
{
"name": "dev",
"path": "/nix/store/jvw9nsblsbh9m4n551sq7qnw82hhsv08-postgresql-16.4-dev"
},
{
"name": "doc",
"path": "/nix/store/fk1x8k1qsiaasp73qnzyrzw4ylaf1xy6-postgresql-16.4-doc"
}
],
"store_path": "/nix/store/j6n9b877yhrnkp9z9p1gllxpnfvdrbrb-postgresql-16.4"
},
"aarch64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/2ywn472iqfdiyw5w4frm63rn3nyrkgn1-postgresql-16.4",
"default": true
},
{
"name": "man",
"path": "/nix/store/650fqsb195p9x00jgqgzkisjwddbvgfd-postgresql-16.4-man",
"default": true
},
{
"name": "debug",
"path": "/nix/store/wm34pd2y04mjgvhanqw4ymmhds56l9da-postgresql-16.4-debug"
},
{
"name": "dev",
"path": "/nix/store/ai2ckvi44jdh9i5078gj5brdwsxk4ydm-postgresql-16.4-dev"
},
{
"name": "doc",
"path": "/nix/store/qys6z2y4iwr0f6ahpq9gcv9hb551w479-postgresql-16.4-doc"
},
{
"name": "lib",
"path": "/nix/store/pii1vyxbzggi7aqy7xglav8p52c0qfp2-postgresql-16.4-lib"
}
],
"store_path": "/nix/store/2ywn472iqfdiyw5w4frm63rn3nyrkgn1-postgresql-16.4"
},
"x86_64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/5k1p2jjnsdcsvk8zpsqxlzhajh1x9ghq-postgresql-16.4",
"default": true
},
{
"name": "man",
"path": "/nix/store/p8b24icm7xiwlky1dggqcinn1ah92agl-postgresql-16.4-man",
"default": true
},
{
"name": "dev",
"path": "/nix/store/cvl9wdw387jk02bbhm1qvidzl18hayyr-postgresql-16.4-dev"
},
{
"name": "doc",
"path": "/nix/store/ysmwxhh3s2l1k2jkzxq0bv6vdzlgr14j-postgresql-16.4-doc"
},
{
"name": "lib",
"path": "/nix/store/4va0gp1c718dk1zyqs0il2gn7a81spr0-postgresql-16.4-lib"
}
],
"store_path": "/nix/store/5k1p2jjnsdcsvk8zpsqxlzhajh1x9ghq-postgresql-16.4"
},
"x86_64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/ypx0whdqvwbql73nija0zrm4z3rgcm9l-postgresql-16.4",
"default": true
},
{
"name": "man",
"path": "/nix/store/7x75jfmpc7x36863cf6kr61ikcz787ki-postgresql-16.4-man",
"default": true
},
{
"name": "doc",
"path": "/nix/store/4c7h8sg2i0jim6hzmzhjw5nn0zmx1xvd-postgresql-16.4-doc"
},
{
"name": "lib",
"path": "/nix/store/xd8ks7bs2p7gjgk8h98bfg8801swl9m0-postgresql-16.4-lib"
},
{
"name": "debug",
"path": "/nix/store/pxhd0wq2sbafamjmcp7f890qza76gwav-postgresql-16.4-debug"
},
{
"name": "dev",
"path": "/nix/store/20i6jma3fbm4sw060hdnrs311fw4aczj-postgresql-16.4-dev"
}
],
"store_path": "/nix/store/ypx0whdqvwbql73nija0zrm4z3rgcm9l-postgresql-16.4"
}
}
},
"skate@latest": {
"last_modified": "2024-11-16T04:25:12Z",
"resolved": "github:NixOS/nixpkgs/34a626458d686f1b58139620a8b2793e9e123bba#skate",
"source": "devbox-search",
"version": "1.0.0",
"systems": {
"aarch64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/q6yhpyfbqiabyic6ymx5rp2db62bnbvr-skate-1.0.0",
"default": true
}
],
"store_path": "/nix/store/q6yhpyfbqiabyic6ymx5rp2db62bnbvr-skate-1.0.0"
},
"aarch64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/q55dbgvc4xwvr2g02dks6j2j699qni2k-skate-1.0.0",
"default": true
}
],
"store_path": "/nix/store/q55dbgvc4xwvr2g02dks6j2j699qni2k-skate-1.0.0"
},
"x86_64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/s1hy525y8ciya3nrns9kryy3jlcw8igv-skate-1.0.0",
"default": true
}
],
"store_path": "/nix/store/s1hy525y8ciya3nrns9kryy3jlcw8igv-skate-1.0.0"
},
"x86_64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/8s03iazymz77nv6pjxpz7wair0m646wv-skate-1.0.0",
"default": true
}
],
"store_path": "/nix/store/8s03iazymz77nv6pjxpz7wair0m646wv-skate-1.0.0"
}
}
},
"tigerbeetle@latest": {
"last_modified": "2024-11-16T04:25:12Z",
"resolved": "github:NixOS/nixpkgs/34a626458d686f1b58139620a8b2793e9e123bba#tigerbeetle",
"source": "devbox-search",
"version": "0.16.12",
"systems": {
"aarch64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/mm3jzwf24p35afr55v7kl5a0h6962i6p-tigerbeetle-0.16.12",
"default": true
}
],
"store_path": "/nix/store/mm3jzwf24p35afr55v7kl5a0h6962i6p-tigerbeetle-0.16.12"
},
"aarch64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/4106973gg3crfxq0gwrgwn4hcx64mzyy-tigerbeetle-0.16.12",
"default": true
}
],
"store_path": "/nix/store/4106973gg3crfxq0gwrgwn4hcx64mzyy-tigerbeetle-0.16.12"
},
"x86_64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/6lnwnr3mvdamm5lxjjqkaagw2pyqlq0a-tigerbeetle-0.16.12",
"default": true
}
],
"store_path": "/nix/store/6lnwnr3mvdamm5lxjjqkaagw2pyqlq0a-tigerbeetle-0.16.12"
},
"x86_64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/afrj2ph61xz0lh7f3d1g1d7v2rslbvny-tigerbeetle-0.16.12",
"default": true
}
],
"store_path": "/nix/store/afrj2ph61xz0lh7f3d1g1d7v2rslbvny-tigerbeetle-0.16.12"
}
}
}
}
}
-29
View File
@@ -1,29 +0,0 @@
version: "0.6"
processes:
ipfs:
namespace: testnet
command: "devbox run ipfs"
background: true
availability:
restart: never
max_restarts: 0
sonr:
namespace: testnet
background: true
command: "devbox run sonr"
restart: never
max_restarts: 1
depends:
- ipfs
hway:
namespace: testnet
background: true
command: "devbox run hway"
restart: never
max_restarts: 1
depends:
- ipfs
- sonr
-85
View File
@@ -1,85 +0,0 @@
/*
This file defines the database schema for the PostgresQL ("psql") event sink
implementation in CometBFT. The operator must create a database and install
this schema before using the database to index events.
*/
-- The blocks table records metadata about each block.
-- The block record does not include its events or transactions (see tx_results).
CREATE TABLE blocks (
rowid BIGSERIAL PRIMARY KEY,
height BIGINT NOT NULL,
chain_id VARCHAR NOT NULL,
-- When this block header was logged into the sink, in UTC.
created_at TIMESTAMPTZ NOT NULL,
UNIQUE (height, chain_id)
);
-- Index blocks by height and chain, since we need to resolve block IDs when
-- indexing transaction records and transaction events.
CREATE INDEX idx_blocks_height_chain ON blocks(height, chain_id);
-- The tx_results table records metadata about transaction results. Note that
-- the events from a transaction are stored separately.
CREATE TABLE tx_results (
rowid BIGSERIAL PRIMARY KEY,
-- The block to which this transaction belongs.
block_id BIGINT NOT NULL REFERENCES blocks(rowid),
-- The sequential index of the transaction within the block.
index INTEGER NOT NULL,
-- When this result record was logged into the sink, in UTC.
created_at TIMESTAMPTZ NOT NULL,
-- The hex-encoded hash of the transaction.
tx_hash VARCHAR NOT NULL,
-- The protobuf wire encoding of the TxResult message.
tx_result BYTEA NOT NULL,
UNIQUE (block_id, index)
);
-- The events table records events. All events (both block and transaction) are
-- associated with a block ID; transaction events also have a transaction ID.
CREATE TABLE events (
rowid BIGSERIAL PRIMARY KEY,
-- The block and transaction this event belongs to.
-- If tx_id is NULL, this is a block event.
block_id BIGINT NOT NULL REFERENCES blocks(rowid),
tx_id BIGINT NULL REFERENCES tx_results(rowid),
-- The application-defined type label for the event.
type VARCHAR NOT NULL
);
-- The attributes table records event attributes.
CREATE TABLE attributes (
event_id BIGINT NOT NULL REFERENCES events(rowid),
key VARCHAR NOT NULL, -- bare key
composite_key VARCHAR NOT NULL, -- composed type.key
value VARCHAR NULL,
UNIQUE (event_id, key)
);
-- A joined view of events and their attributes. Events that do not have any
-- attributes are represented as a single row with empty key and value fields.
CREATE VIEW event_attributes AS
SELECT block_id, tx_id, type, key, composite_key, value
FROM events LEFT JOIN attributes ON (events.rowid = attributes.event_id);
-- A joined view of all block events (those having tx_id NULL).
CREATE VIEW block_events AS
SELECT blocks.rowid as block_id, height, chain_id, type, key, composite_key, value
FROM blocks JOIN event_attributes ON (blocks.rowid = event_attributes.block_id)
WHERE event_attributes.tx_id IS NULL;
-- A joined view of all transaction events.
CREATE VIEW tx_events AS
SELECT height, index, chain_id, type, key, composite_key, value, tx_results.created_at
FROM blocks JOIN tx_results ON (blocks.rowid = tx_results.block_id)
JOIN event_attributes ON (tx_results.rowid = event_attributes.tx_id)
WHERE event_attributes.tx_id IS NOT NULL;
-44
View File
@@ -1,44 +0,0 @@
{
"$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.12.0/.schema/devbox.schema.json",
"packages": [
"go@1.22",
"bun@latest",
"gum@latest",
"ipfs@latest",
"skate@latest",
"air@latest",
"go-task@latest",
"templ@latest",
"tigerbeetle@latest",
"process-compose@latest"
],
"env": {
"GOPATH": "$HOME/go",
"PATH": "./build:$HOME/go/bin:$PATH",
"CHAIN_ID": "sonr-testnet-1",
"DENOM": "usnr",
"KEYRING": "test",
"MONIKER": "florence",
"BINARY": "sonrd",
"ACC0_NAME": "acc0",
"ACC1_NAME": "acc1",
"ACC0_ADDRESS": "idx1efd63aw40lxf3n4mhf7dzhjkr453axur9vjt6y",
"ACC1_ADDRESS": "idx1hj5fveer5cjtn4wd6wstzugjfdxzl0xpecp0nd",
"ACC0_MNEMONIC": "$(skate get ACC0_MNEMONIC)",
"ACC1_MNEMONIC": "$(skate get ACC1_MNEMONIC)",
"TUNNEL_TOKEN": "$(skate get CLOUDFLARE_TUNNEL_TOKEN)",
"TURNSTILE_SITE_KEY": "$(skate get TURNSTILE_SITE_KEY)",
"TEMPL_EXPERIMENT": "rawgo"
},
"shell": {
"scripts": {
"deploy": [
"gum spin --title='Generating PKL' -- make pkl-gen",
"gum spin --title='Building Motr WASM' -- make motr-build",
"gum spin --title='Uploading to Bucket' -- make deploy-cdn"
],
"devnet": ["process-compose up -f deploy/devnet/process-compose.yaml"],
"testnet": ["process-compose run -f deploy/testnet/process-compose.yaml"]
}
}
}
-443
View File
@@ -1,443 +0,0 @@
{
"lockfile_version": "1",
"packages": {
"air@latest": {
"last_modified": "2024-11-28T07:51:56Z",
"resolved": "github:NixOS/nixpkgs/226216574ada4c3ecefcbbec41f39ce4655f78ef#air",
"source": "devbox-search",
"version": "1.61.1",
"systems": {
"aarch64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/0s90vbnmsyyixs0991md21pbrw8babfb-air-1.61.1",
"default": true
}
],
"store_path": "/nix/store/0s90vbnmsyyixs0991md21pbrw8babfb-air-1.61.1"
},
"aarch64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/8mpw2asxs297v26fxqy2y1bq438f344l-air-1.61.1",
"default": true
}
],
"store_path": "/nix/store/8mpw2asxs297v26fxqy2y1bq438f344l-air-1.61.1"
},
"x86_64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/abminkf7ldqf9vm14xx5wvsrdx3wrvy6-air-1.61.1",
"default": true
}
],
"store_path": "/nix/store/abminkf7ldqf9vm14xx5wvsrdx3wrvy6-air-1.61.1"
},
"x86_64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/ajx8v5rbbvglncb97yybg3x9kn95gfrm-air-1.61.1",
"default": true
}
],
"store_path": "/nix/store/ajx8v5rbbvglncb97yybg3x9kn95gfrm-air-1.61.1"
}
}
},
"bun@latest": {
"last_modified": "2024-11-26T10:33:56Z",
"resolved": "github:NixOS/nixpkgs/af51545ec9a44eadf3fe3547610a5cdd882bc34e#bun",
"source": "devbox-search",
"version": "1.1.34",
"systems": {
"aarch64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/0hxh6hmzkpg56l11vsnyb287jynhf5f4-bun-1.1.34",
"default": true
}
],
"store_path": "/nix/store/0hxh6hmzkpg56l11vsnyb287jynhf5f4-bun-1.1.34"
},
"aarch64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/mc6bikx8a0rqm1xk040w2q861syxpr8d-bun-1.1.34",
"default": true
}
],
"store_path": "/nix/store/mc6bikx8a0rqm1xk040w2q861syxpr8d-bun-1.1.34"
},
"x86_64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/fn9h6y3v8il2yax5pm965lacxzj8pq9q-bun-1.1.34",
"default": true
}
],
"store_path": "/nix/store/fn9h6y3v8il2yax5pm965lacxzj8pq9q-bun-1.1.34"
},
"x86_64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/mzk71frmsppga4i7sz7ca3r9wxv8slx9-bun-1.1.34",
"default": true
}
],
"store_path": "/nix/store/mzk71frmsppga4i7sz7ca3r9wxv8slx9-bun-1.1.34"
}
}
},
"go-task@latest": {
"last_modified": "2024-11-28T07:51:56Z",
"resolved": "github:NixOS/nixpkgs/226216574ada4c3ecefcbbec41f39ce4655f78ef#go-task",
"source": "devbox-search",
"version": "3.40.0",
"systems": {
"aarch64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/ynnx5bghcar86a89026rdysvpf51b2li-go-task-3.40.0",
"default": true
}
],
"store_path": "/nix/store/ynnx5bghcar86a89026rdysvpf51b2li-go-task-3.40.0"
},
"aarch64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/2ga7yc7nn0k01n2w3wa6fjbp0i31r6d6-go-task-3.40.0",
"default": true
}
],
"store_path": "/nix/store/2ga7yc7nn0k01n2w3wa6fjbp0i31r6d6-go-task-3.40.0"
},
"x86_64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/0fc73lrh98s9i7qjsxk8gjddxam5kv76-go-task-3.40.0",
"default": true
}
],
"store_path": "/nix/store/0fc73lrh98s9i7qjsxk8gjddxam5kv76-go-task-3.40.0"
},
"x86_64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/x5pbyv5p0yj3fl77j4bmgcj8s7jjcjwn-go-task-3.40.0",
"default": true
}
],
"store_path": "/nix/store/x5pbyv5p0yj3fl77j4bmgcj8s7jjcjwn-go-task-3.40.0"
}
}
},
"go@1.22": {
"last_modified": "2024-11-28T07:51:56Z",
"resolved": "github:NixOS/nixpkgs/226216574ada4c3ecefcbbec41f39ce4655f78ef#go_1_22",
"source": "devbox-search",
"version": "1.22.9",
"systems": {
"aarch64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/4nf51i4ah186y2jy3fad2fyvpa49qx6q-go-1.22.9",
"default": true
}
],
"store_path": "/nix/store/4nf51i4ah186y2jy3fad2fyvpa49qx6q-go-1.22.9"
},
"aarch64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/8w8vzwgp55yl8j1ljgm4wzdgjkvkv5v3-go-1.22.9",
"default": true
}
],
"store_path": "/nix/store/8w8vzwgp55yl8j1ljgm4wzdgjkvkv5v3-go-1.22.9"
},
"x86_64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/vlih7j78ki05i8nvzdsxvws7a7ksq04m-go-1.22.9",
"default": true
}
],
"store_path": "/nix/store/vlih7j78ki05i8nvzdsxvws7a7ksq04m-go-1.22.9"
},
"x86_64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/frc5188kgv3ws0n999c7cy5vi2f8k4jp-go-1.22.9",
"default": true
}
],
"store_path": "/nix/store/frc5188kgv3ws0n999c7cy5vi2f8k4jp-go-1.22.9"
}
}
},
"gum@latest": {
"last_modified": "2024-11-16T04:25:12Z",
"resolved": "github:NixOS/nixpkgs/34a626458d686f1b58139620a8b2793e9e123bba#gum",
"source": "devbox-search",
"version": "0.14.5",
"systems": {
"aarch64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/rzqm62ixipbzbhfagqlic5xxag9a2v82-gum-0.14.5",
"default": true
}
],
"store_path": "/nix/store/rzqm62ixipbzbhfagqlic5xxag9a2v82-gum-0.14.5"
},
"aarch64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/3ick2j8z9jgkk3cyc1ik4zkbs3m4583n-gum-0.14.5",
"default": true
}
],
"store_path": "/nix/store/3ick2j8z9jgkk3cyc1ik4zkbs3m4583n-gum-0.14.5"
},
"x86_64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/9rh8qxbxgb07v3a62mx9404ynk2yhxrj-gum-0.14.5",
"default": true
}
],
"store_path": "/nix/store/9rh8qxbxgb07v3a62mx9404ynk2yhxrj-gum-0.14.5"
},
"x86_64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/1bnivwijzrnzx5h0hd5rywwy8rlhxmw5-gum-0.14.5",
"default": true
}
],
"store_path": "/nix/store/1bnivwijzrnzx5h0hd5rywwy8rlhxmw5-gum-0.14.5"
}
}
},
"ipfs@latest": {
"last_modified": "2023-02-24T09:01:09Z",
"resolved": "github:NixOS/nixpkgs/7d0ed7f2e5aea07ab22ccb338d27fbe347ed2f11#ipfs",
"source": "devbox-search",
"version": "0.17.0"
},
"process-compose@latest": {
"last_modified": "2024-11-28T07:51:56Z",
"resolved": "github:NixOS/nixpkgs/226216574ada4c3ecefcbbec41f39ce4655f78ef#process-compose",
"source": "devbox-search",
"version": "1.40.1",
"systems": {
"aarch64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/ndvh1v1881a3pwxyw1g38mhp5xzrpz16-process-compose-1.40.1",
"default": true
}
],
"store_path": "/nix/store/ndvh1v1881a3pwxyw1g38mhp5xzrpz16-process-compose-1.40.1"
},
"aarch64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/7jw864z6wlzcirsz8fgaj2bw0f22izch-process-compose-1.40.1",
"default": true
}
],
"store_path": "/nix/store/7jw864z6wlzcirsz8fgaj2bw0f22izch-process-compose-1.40.1"
},
"x86_64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/qz9gb3briakkvylq3markxd1s7plaw47-process-compose-1.40.1",
"default": true
}
],
"store_path": "/nix/store/qz9gb3briakkvylq3markxd1s7plaw47-process-compose-1.40.1"
},
"x86_64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/0vq97wmm879440n8plsk1yjc1g28ai85-process-compose-1.40.1",
"default": true
}
],
"store_path": "/nix/store/0vq97wmm879440n8plsk1yjc1g28ai85-process-compose-1.40.1"
}
}
},
"skate@latest": {
"last_modified": "2024-11-28T07:51:56Z",
"resolved": "github:NixOS/nixpkgs/226216574ada4c3ecefcbbec41f39ce4655f78ef#skate",
"source": "devbox-search",
"version": "1.0.0",
"systems": {
"aarch64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/q6yhpyfbqiabyic6ymx5rp2db62bnbvr-skate-1.0.0",
"default": true
}
],
"store_path": "/nix/store/q6yhpyfbqiabyic6ymx5rp2db62bnbvr-skate-1.0.0"
},
"aarch64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/q55dbgvc4xwvr2g02dks6j2j699qni2k-skate-1.0.0",
"default": true
}
],
"store_path": "/nix/store/q55dbgvc4xwvr2g02dks6j2j699qni2k-skate-1.0.0"
},
"x86_64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/s1hy525y8ciya3nrns9kryy3jlcw8igv-skate-1.0.0",
"default": true
}
],
"store_path": "/nix/store/s1hy525y8ciya3nrns9kryy3jlcw8igv-skate-1.0.0"
},
"x86_64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/8s03iazymz77nv6pjxpz7wair0m646wv-skate-1.0.0",
"default": true
}
],
"store_path": "/nix/store/8s03iazymz77nv6pjxpz7wair0m646wv-skate-1.0.0"
}
}
},
"templ@latest": {
"last_modified": "2024-11-28T07:51:56Z",
"resolved": "github:NixOS/nixpkgs/226216574ada4c3ecefcbbec41f39ce4655f78ef#templ",
"source": "devbox-search",
"version": "0.2.793",
"systems": {
"aarch64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/ivargvf76g71k5gk3iz4al52rsy28w38-templ-0.2.793",
"default": true
}
],
"store_path": "/nix/store/ivargvf76g71k5gk3iz4al52rsy28w38-templ-0.2.793"
},
"aarch64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/03654iddn006yx5j1lqq496hax60v8p5-templ-0.2.793",
"default": true
}
],
"store_path": "/nix/store/03654iddn006yx5j1lqq496hax60v8p5-templ-0.2.793"
},
"x86_64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/blvd5wbd1ix6m745s4zx3b84kwzprshq-templ-0.2.793",
"default": true
}
],
"store_path": "/nix/store/blvd5wbd1ix6m745s4zx3b84kwzprshq-templ-0.2.793"
},
"x86_64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/sn5h79d36r86i6a8rm1k52c2ij1s32kx-templ-0.2.793",
"default": true
}
],
"store_path": "/nix/store/sn5h79d36r86i6a8rm1k52c2ij1s32kx-templ-0.2.793"
}
}
},
"tigerbeetle@latest": {
"last_modified": "2024-11-30T03:39:21Z",
"resolved": "github:NixOS/nixpkgs/4703b8d2c708e13a8cab03d865f90973536dcdf5#tigerbeetle",
"source": "devbox-search",
"version": "0.16.14",
"systems": {
"aarch64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/jgcj3ci7708zsgirgjl4cdnaq7x59fm4-tigerbeetle-0.16.14",
"default": true
}
],
"store_path": "/nix/store/jgcj3ci7708zsgirgjl4cdnaq7x59fm4-tigerbeetle-0.16.14"
},
"aarch64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/b4zqvr0zanwvdz8c7fs6w1h51fh6pa1j-tigerbeetle-0.16.14",
"default": true
}
],
"store_path": "/nix/store/b4zqvr0zanwvdz8c7fs6w1h51fh6pa1j-tigerbeetle-0.16.14"
},
"x86_64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/nqi4rb34bdcra0sx59dnipdp347smndx-tigerbeetle-0.16.14",
"default": true
}
],
"store_path": "/nix/store/nqi4rb34bdcra0sx59dnipdp347smndx-tigerbeetle-0.16.14"
},
"x86_64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/224jvdiazicsmm1r5dpykk912rzlyhgr-tigerbeetle-0.16.14",
"default": true
}
],
"store_path": "/nix/store/224jvdiazicsmm1r5dpykk912rzlyhgr-tigerbeetle-0.16.14"
}
}
}
}
}
+1
View File
@@ -0,0 +1 @@
onsonr.dev
+111
View File
@@ -1,3 +1,114 @@
## v0.5.22 (2024-12-11)
### Feat
- Implement passkey-based authentication and registration flow
## v0.5.21 (2024-12-11)
### Feat
- allow manual triggering of deployment workflow
- add start-tui command for interactive mode
- add coin selection and update passkey input in registration form
- add hway command for Sonr DID gateway
- Conditionally install process-compose only if binary not found
- Add process-compose support with custom start and down commands
- implement passkey registration flow
- Improve createProfile form layout with wider max-width and enhanced spacing
- improve index page UI with new navigation buttons and remove redundant settings buttons
- Make input rows responsive with grid layout for mobile and desktop
- enhance index page with additional settings buttons and style adjustments
- implement passkey-based authentication
- add support for Cloudsmith releases
- add go dependency and enhance devbox environment variables
- update create profile form placeholders and handle
- add DID-based authentication middleware
- Add validation for human verification slider sum in CreateProfile form
- implement passkey registration flow
- Update WebAuthn credential handling with modern browser standards
- Streamline passkey registration with automatic form submission
- Add credential parsing and logging in register finish handler
- Add credential details row with icon after passkey creation
- Add form validation for passkey credential input
- implement passkey registration flow
- Add hidden input to store passkey credential data for form submission
- add CI workflow for deploying network
- add hway binary support and Homebrew formula
- remove username from passkey creation
- implement passkey registration flow
- add passkey creation functionality
- add CNAME for onsonr.dev domain
### Fix
- use Unix domain sockets for devnet processes
- correct workflow name and improve devnet deployment process
- correct title of profile creation page
- rename devbox start script to up and remove stop script
- Consolidate archive configuration and add LICENSE file
- Improve cross-browser passkey credential handling and encoding
- Remove commented-out code in passkey registration script
- remove line-clamp from tailwind config
- remove unnecessary background and restart settings from process-compose.yaml
- suppress process-compose server output and log to file
### Refactor
- remove unnecessary git fetch step in deploy workflow
- remove obsolete interchain test dependencies
- update index views to use new nebula components
- move Wasm related code to pkg/common/wasm
- migrate config package to pkg directory
- migrate to new configuration system and model definitions
- move session package to pkg directory
- Refactor registration forms to use UI components
- move gateway config to vault package
- improve command line flag descriptions and variable names
- refactor hway command to use echo framework for server
- Update root command to load EnvImpl from cobra flags
- Modify command flags and environment loading logic in cmds.go
- improve build process and move process-compose.yaml
- remove unused devbox.json and related configurations
- Improve mobile layout responsiveness for Rows and Columns components
- Remove max-w-fit from Rows component
- replace session package with context package
- rename database initialization function
- move session management to dedicated database module
- remove unused UI components related to wallet and index pages
- consolidate handlers into single files
- move gateway and vault packages to internal directory
- Move registration form components to dedicated directory
- remove unused devbox package
- remove devbox configuration
- move vault package to app directory
- improve code structure within gateway package
- move gateway package to app directory
- move vault package internal components to root
- migrate layout imports to common styles package
- Move form templates and styles to common directory
- consolidate authentication and DID handling logic
- Improve WebAuthn credential handling and validation in register finish route
- remove profile card component
- Simplify passkey registration UI and move profile component inline
- Update credential logging with transport and ID type
- Update register handler to use protocol.CredentialDescriptor struct
- Update credential handling to use protocol.CredentialDescriptor
- improve profile card styling and functionality
- Simplify session management and browser information extraction
- Update PeerInfo to extract and store comprehensive device information
- improve address display in property details
- remove unused documentation generation script
- replace sonr/pkg/styles/layout with nebula/ui/layout
- migrate UI components to nebula module
- improve scopes.json structure and update scripts for better usability
## v0.5.20 (2024-12-07)
### Refactor
- simplify CI workflow by removing redundant asset publishing steps
## v0.5.19 (2024-12-06)
### Feat
-118
View File
@@ -1,118 +0,0 @@
<div class="splash">
<div class="splash-start">
<img class="splash-logo" src="/assets/images/wordmark.svg" alt="Shoelace">
# <sl-visually-hidden>Shoelace:</sl-visually-hidden> A forward-thinking library of web components.
- Works with all frameworks 🧩
- Works with CDNs 🚛
- Fully customizable with CSS 🎨
- Includes a dark theme 🌛
- Built with accessibility in mind ♿️
- First-class [React support](/frameworks/react) ⚛️
- Built-in localization 💬
- Open source 😸
- [More awesome than ever](https://blog.fontawesome.com/shoelace-joins-font-awesome/) ![Awesome emoji](/assets/images/awesome.svg)
</div>
<div class="splash-end">
<img class="splash-image" src="/assets/images/undraw-content-team.svg" alt="Cartoon of people assembling components while standing on a giant laptop.">
</div>
</div>
<div class="badges">
[![jsDelivr](https://data.jsdelivr.com/v1/package/npm/@shoelace-style/shoelace/badge)](https://www.jsdelivr.com/package/npm/@shoelace-style/shoelace)
[![npm](https://img.shields.io/npm/dw/@shoelace-style/shoelace?label=npm&style=flat-square)](https://www.npmjs.com/package/@shoelace-style/shoelace)
[![License](https://img.shields.io/badge/license-MIT-232323.svg?style=flat-square)](https://github.com/shoelace-style/shoelace/blob/next/LICENSE.md)<br>
[![Discord](https://img.shields.io/badge/Discord-Join%20the%20chat-5965f2.svg?style=flat-square&logo=discord&logoColor=white)](https://discord.gg/mg8f26C)
[![Twitter](https://img.shields.io/badge/Twitter-Follow-00acee.svg?style=flat-square&logo=twitter&logoColor=white)](https://twitter.com/shoelace_style)
[![Sponsor](https://img.shields.io/badge/GitHub-Code-232323.svg?style=flat-square&logo=github&logoColor=white)](https://github.com/shoelace-style/shoelace)
</div>
## Quick Start
Add the following code to your page.
<!-- prettier-ignore -->
```html
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@%VERSION%/%CDNDIR%/themes/light.css" />
<script type="module" src="https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@%VERSION%/%CDNDIR%/shoelace-autoloader.js"></script>
```
Now you have access to all of Shoelace's components! Try adding a button:
```html:preview:expanded:no-codepen
<sl-button>Click me</sl-button>
```
:::tip
This will activate Shoelace's experimental autoloader, which registers components on the fly as you use them. To learn more about it, or for other ways to install Shoelace, refer to the [installation instructions](getting-started/installation).
:::
## New to Web Components?
**TL;DR**  we finally have a way to create [our own HTML elements](https://html.spec.whatwg.org/multipage/custom-elements.html) and use them in any framework we want!
Thanks to the popularity of frameworks such as Angular, Vue, and React, component-driven development has become a part of our every day lives. Components help us encapsulate styles and behaviors into reusable building blocks. They make a lot of sense in terms of design, development, and testing.
Unfortunately, _framework-specific_ components fail us in a number of ways:
- You can only use them in the framework they're designed for 🔒
- Their lifespan is limited to that of the framework's ⏳
- New frameworks/versions can lead to breaking changes, requiring substantial effort to update components 😭
Web components solve these problems. They're [supported by all modern browsers](https://caniuse.com/#feat=custom-elementsv1), they're framework-agnostic, and they're [part of the standard](https://developer.mozilla.org/en-US/docs/Web/Web_Components), so we know they'll be supported for many years to come.
This is the technology that Shoelace is built on.
## What Problem Does This Solve?
Shoelace provides a collection of professionally designed, highly customizable UI components built on a framework agnostic technology. Why spend hundreds of hours (or more) building a design system from scratch? Why make a component library that only works with one framework?
With Shoelace, you can:
- Start building things faster (no need to roll your own buttons)
- Build multiple apps with different frameworks that all share the same UI components
- Fully customize components to match your existing designs
- Incrementally adopt components as needed (no need to ditch your framework)
- Upgrade or switch frameworks without rebuilding foundational components
If your organization is looking to build a design system, [Shoelace will save you thousands of dollars](https://medium.com/eightshapes-llc/and-you-thought-buttons-were-easy-26eb5b5c1871). All the foundational components you need are right here, ready to be customized for your brand. And since it's built on web standards, browsers will continue to support it for many years to come.
Whether you use Shoelace as a starting point for your organization's design system or for a fun personal project, there's no limit to what you can do with it.
## Browser Support
Shoelace is tested in the latest two versions of the following browsers.
<img src="/assets/images/chrome.png" alt="Chrome" width="64" height="64">
<img src="/assets/images/edge.png" alt="Edge" width="64" height="64">
<img src="/assets/images/firefox.png" alt="Firefox" width="64" height="64">
<img src="/assets/images/opera.png" alt="Opera" width="64" height="64">
<img src="/assets/images/safari.png" alt="Safari" width="64" height="64">
Critical bug fixes in earlier versions will be addressed based on their severity and impact.
If you need to support IE11 or pre-Chromium Edge, this library isn't for you. Although web components can (to some degree) be polyfilled for legacy browsers, supporting them is outside the scope of this project. If you're using Shoelace in such a browser, you're gonna have a bad time. ⛷
## License
Shoelace was created in New Hampshire by [Cory LaViska](https://twitter.com/claviska). It's available under the terms of the [MIT license](https://github.com/shoelace-style/shoelace/blob/next/LICENSE.md).
## Attribution
Special thanks to the following projects and individuals that help make Shoelace possible.
- Components are built with [Lit](https://lit.dev/)
- Component metadata is generated by the [Custom Elements Manifest Analyzer](https://github.com/open-wc/custom-elements-manifest)
- Documentation is powered by [11ty](https://www.11ty.dev/)
- CDN services are provided by [jsDelivr](https://www.jsdelivr.com/)
- Color primitives are inspired by [Tailwind](https://tailwindcss.com/)
- Icons are courtesy of [Bootstrap Icons](https://icons.getbootstrap.com/)
- The homepage illustration is courtesy of [unDraw](https://undraw.co/)
- Positioning of dropdowns, tooltips, et al is handled by [Floating UI](https://floating-ui.com/)
- Animations are courtesy of [animate.css](https://animate.style/)
- Search is powered by [Lunr](https://lunrjs.com/)
- The Shoelace logo was designed with a single shoelace by [Adam K Olson](https://twitter.com/adamkolson)
+1
View File
@@ -0,0 +1 @@
# Sonr Blockchain
+11
View File
@@ -0,0 +1,11 @@
<div style="text-align: center;">
# Page Not Found
![A UFO takes one of the little worker monsters](/assets/images/undraw-taken.svg)
The page you were looking for couldn't be found.
Press [[/]] to search, or [head back to the homepage](/).
</div>
+2 -2
View File
@@ -51,5 +51,5 @@ theme:
icon: material/toggle-switch-off
name: Switch to system preference
font:
text: Roboto
code: Roboto Mono
text: Geist
code: Geist Mono
+2 -4
View File
@@ -1,8 +1,6 @@
module github.com/onsonr/sonr
go 1.23
toolchain go1.23.1
go 1.23.3
// overrides
replace (
@@ -94,6 +92,7 @@ require (
github.com/strangelove-ventures/tokenfactory v0.50.0
github.com/stretchr/testify v1.10.0
golang.org/x/crypto v0.30.0
golang.org/x/exp v0.0.0-20241204233417-43b7b7cde48d
google.golang.org/genproto/googleapis/api v0.0.0-20241007155032-5fefd90f89a9
google.golang.org/grpc v1.67.1
google.golang.org/protobuf v1.35.2
@@ -354,7 +353,6 @@ require (
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // indirect
go4.org v0.0.0-20230225012048-214862532bf5 // indirect
golang.org/x/exp v0.0.0-20241204233417-43b7b7cde48d // indirect
golang.org/x/mod v0.22.0 // indirect
golang.org/x/net v0.32.0 // indirect
golang.org/x/oauth2 v0.23.0 // indirect
-47
View File
@@ -1,47 +0,0 @@
package e2e
import (
"context"
"testing"
"github.com/strangelove-ventures/interchaintest/v8"
"github.com/strangelove-ventures/interchaintest/v8/chain/cosmos"
"github.com/stretchr/testify/require"
"go.uber.org/zap/zaptest"
)
func TestBasicChain(t *testing.T) {
cf := interchaintest.NewBuiltinChainFactory(zaptest.NewLogger(t), []*interchaintest.ChainSpec{
&DefaultChainSpec,
})
chains, err := cf.Chains(t.Name())
require.NoError(t, err)
chain := chains[0].(*cosmos.CosmosChain)
ic := interchaintest.NewInterchain().
AddChain(chain)
ctx := context.Background()
client, network := interchaintest.DockerSetup(t)
require.NoError(t, ic.Build(ctx, nil, interchaintest.InterchainBuildOptions{
TestName: t.Name(),
Client: client,
NetworkID: network,
SkipPathCreation: true,
}))
t.Cleanup(func() {
_ = ic.Close()
})
// faucet funds to the user
users := interchaintest.GetAndFundTestUsers(t, ctx, "default", GenesisFundsAmount, chain)
user := users[0]
// balance check
balance, err := chain.GetBalance(ctx, user.FormattedAddress(), Denom)
require.NoError(t, err)
require.True(t, balance.Equal(GenesisFundsAmount), "user balance should be equal to genesis funds")
}
-280
View File
@@ -1,280 +0,0 @@
module github.com/di-dao/core/interchaintest
go 1.22
toolchain go1.22.7
replace (
// not tagged properly (SDK v51)
cosmossdk.io/core => cosmossdk.io/core v0.11.0
github.com/ChainSafe/go-schnorrkel => github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d
github.com/ChainSafe/go-schnorrkel/1 => github.com/ChainSafe/go-schnorrkel v1.0.0
github.com/btcsuite/btcd => github.com/btcsuite/btcd v0.22.2 //indirect
github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1
// breaks SDK app.toml parsing for client configs.
github.com/spf13/viper => github.com/spf13/viper v1.17.0
// If using custom internal modules, replace your app here with the parent application
// github.com/di-dao/core => ../.
github.com/vedhavyas/go-subkey => github.com/strangelove-ventures/go-subkey v1.0.7
)
require (
cosmossdk.io/math v1.3.0
github.com/cosmos/cosmos-sdk v0.50.5
github.com/cosmos/ibc-go/v8 v8.2.0
github.com/strangelove-ventures/globalfee v0.50.0
github.com/strangelove-ventures/interchaintest/v8 v8.1.0
github.com/strangelove-ventures/poa v0.50.0
github.com/strangelove-ventures/tokenfactory v0.50.0
github.com/stretchr/testify v1.9.0
go.uber.org/zap v1.27.0
)
require (
cloud.google.com/go v0.112.0 // indirect
cloud.google.com/go/compute/metadata v0.5.0 // indirect
cloud.google.com/go/iam v1.1.6 // indirect
cloud.google.com/go/storage v1.37.0 // indirect
cosmossdk.io/api v0.7.3 // indirect
cosmossdk.io/collections v0.4.0 // indirect
cosmossdk.io/core v0.12.0 // indirect
cosmossdk.io/depinject v1.0.0-alpha.4 // indirect
cosmossdk.io/errors v1.0.1 // indirect
cosmossdk.io/log v1.3.1 // indirect
cosmossdk.io/store v1.0.2 // indirect
cosmossdk.io/x/feegrant v0.1.0 // indirect
cosmossdk.io/x/tx v0.13.1 // indirect
cosmossdk.io/x/upgrade v0.1.1 // indirect
filippo.io/edwards25519 v1.0.0 // indirect
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
github.com/99designs/keyring v1.2.2 // indirect
github.com/BurntSushi/toml v1.4.0 // indirect
github.com/ChainSafe/go-schnorrkel v1.1.0 // indirect
github.com/ChainSafe/go-schnorrkel/1 v0.0.0-00010101000000-000000000000 // indirect
github.com/ComposableFi/go-subkey/v2 v2.0.0-tm03420 // indirect
github.com/DataDog/datadog-go v3.2.0+incompatible // indirect
github.com/DataDog/zstd v1.5.5 // indirect
github.com/FactomProject/basen v0.0.0-20150613233007-fe3947df716e // indirect
github.com/FactomProject/btcutilecc v0.0.0-20130527213604-d3a63a5752ec // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/StirlingMarketingGroup/go-namecase v1.0.0 // indirect
github.com/avast/retry-go/v4 v4.5.1 // indirect
github.com/aws/aws-sdk-go v1.46.6 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect
github.com/bits-and-blooms/bitset v1.10.0 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.4 // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/cespare/xxhash v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/chzyer/readline v1.5.1 // indirect
github.com/cockroachdb/errors v1.11.3 // indirect
github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce // indirect
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect
github.com/cockroachdb/pebble v1.1.1 // indirect
github.com/cockroachdb/redact v1.1.5 // indirect
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect
github.com/cometbft/cometbft v0.38.12 // indirect
github.com/cometbft/cometbft-db v0.11.0 // indirect
github.com/containerd/log v0.1.0 // indirect
github.com/cosmos/btcutil v1.0.5 // indirect
github.com/cosmos/cosmos-db v1.0.2 // indirect
github.com/cosmos/cosmos-proto v1.0.0-beta.4 // indirect
github.com/cosmos/go-bip39 v1.0.0 // indirect
github.com/cosmos/gogogateway v1.2.0 // indirect
github.com/cosmos/gogoproto v1.7.0 // indirect
github.com/cosmos/iavl v1.0.1 // indirect
github.com/cosmos/ibc-go/modules/capability v1.0.0 // indirect
github.com/cosmos/ics23/go v0.10.0 // indirect
github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect
github.com/danieljoos/wincred v1.2.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/deckarep/golang-set v1.8.0 // indirect
github.com/decred/base58 v1.0.5 // indirect
github.com/decred/dcrd/crypto/blake256 v1.0.1 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v2 v2.0.1 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect
github.com/dgraph-io/badger/v2 v2.2007.4 // indirect
github.com/dgraph-io/ristretto v0.1.1 // indirect
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect
github.com/distribution/reference v0.5.0 // indirect
github.com/docker/docker v25.0.6+incompatible // indirect
github.com/docker/go-connections v0.5.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/dvsekhvalnov/jose2go v1.6.0 // indirect
github.com/emicklei/dot v1.6.1 // indirect
github.com/ethereum/go-ethereum v1.14.0 // indirect
github.com/fatih/color v1.15.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/getsentry/sentry-go v0.27.0 // indirect
github.com/go-kit/kit v0.13.0 // indirect
github.com/go-kit/log v0.2.1 // indirect
github.com/go-logfmt/logfmt v0.6.0 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect
github.com/gogo/googleapis v1.4.1 // indirect
github.com/gogo/protobuf v1.3.3 // indirect
github.com/golang/glog v1.2.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/mock v1.6.0 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect
github.com/google/btree v1.1.2 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/orderedcode v0.0.1 // indirect
github.com/google/s2a-go v0.1.7 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
github.com/googleapis/gax-go/v2 v2.12.0 // indirect
github.com/gorilla/handlers v1.5.2 // indirect
github.com/gorilla/mux v1.8.1 // indirect
github.com/gorilla/websocket v1.5.3 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect
github.com/gtank/merlin v0.1.1 // indirect
github.com/gtank/ristretto255 v0.1.2 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-getter v1.7.5 // indirect
github.com/hashicorp/go-hclog v1.5.0 // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
github.com/hashicorp/go-metrics v0.5.2 // indirect
github.com/hashicorp/go-plugin v1.5.2 // indirect
github.com/hashicorp/go-safetemp v1.0.0 // indirect
github.com/hashicorp/go-version v1.6.0 // indirect
github.com/hashicorp/golang-lru v1.0.2 // indirect
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/hashicorp/yamux v0.1.1 // indirect
github.com/hdevalence/ed25519consensus v0.1.0 // indirect
github.com/holiman/uint256 v1.2.4 // indirect
github.com/huandu/skiplist v1.2.0 // indirect
github.com/iancoleman/strcase v0.3.0 // indirect
github.com/icza/dyno v0.0.0-20230330125955-09f820a8d9c0 // indirect
github.com/improbable-eng/grpc-web v0.15.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/ipfs/go-cid v0.4.1 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/jmhodges/levigo v1.0.0 // indirect
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
github.com/klauspost/compress v1.17.9 // indirect
github.com/klauspost/cpuid/v2 v2.2.7 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/lib/pq v1.10.9 // indirect
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
github.com/libp2p/go-libp2p v0.33.2 // indirect
github.com/linxGnu/grocksdb v1.8.12 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/manifoldco/promptui v0.9.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mimoo/StrobeGo v0.0.0-20220103164710-9a04d6ca976b // indirect
github.com/minio/highwayhash v1.0.2 // indirect
github.com/minio/sha256-simd v1.0.1 // indirect
github.com/misko9/go-substrate-rpc-client/v4 v4.0.0-20230913220906-b988ea7da0c2 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mr-tron/base58 v1.2.0 // indirect
github.com/mtibben/percent v0.2.1 // indirect
github.com/multiformats/go-base32 v0.1.0 // indirect
github.com/multiformats/go-base36 v0.2.0 // indirect
github.com/multiformats/go-multiaddr v0.12.3 // indirect
github.com/multiformats/go-multibase v0.2.0 // indirect
github.com/multiformats/go-multicodec v0.9.0 // indirect
github.com/multiformats/go-multihash v0.2.3 // indirect
github.com/multiformats/go-varint v0.0.7 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect
github.com/oklog/run v1.1.0 // indirect
github.com/onsi/gomega v1.30.0 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0-rc5 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
github.com/petermattis/goid v0.0.0-20230904192822-1876fd5063bc // indirect
github.com/pierrec/xxHash v0.1.5 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_golang v1.20.1 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.55.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
github.com/rs/cors v1.11.1 // indirect
github.com/rs/zerolog v1.32.0 // indirect
github.com/sagikazarmark/locafero v0.4.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/sasha-s/go-deadlock v0.3.1 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/cobra v1.8.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.19.0 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect
github.com/tendermint/go-amino v0.16.0 // indirect
github.com/tidwall/btree v1.7.0 // indirect
github.com/tyler-smith/go-bip32 v1.0.0 // indirect
github.com/tyler-smith/go-bip39 v1.1.0 // indirect
github.com/ulikunitz/xz v0.5.11 // indirect
github.com/zondax/hid v0.9.2 // indirect
github.com/zondax/ledger-go v0.14.3 // indirect
go.etcd.io/bbolt v1.3.10 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0 // indirect
go.opentelemetry.io/otel v1.31.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.31.0 // indirect
go.opentelemetry.io/otel/metric v1.31.0 // indirect
go.opentelemetry.io/otel/sdk v1.31.0 // indirect
go.opentelemetry.io/otel/trace v1.31.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.28.0 // indirect
golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect
golang.org/x/mod v0.17.0 // indirect
golang.org/x/net v0.30.0 // indirect
golang.org/x/oauth2 v0.22.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.26.0 // indirect
golang.org/x/term v0.25.0 // indirect
golang.org/x/text v0.19.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect
google.golang.org/api v0.162.0 // indirect
google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20241007155032-5fefd90f89a9 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20241007155032-5fefd90f89a9 // indirect
google.golang.org/grpc v1.67.1 // indirect
google.golang.org/protobuf v1.35.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
gotest.tools/v3 v3.5.1 // indirect
lukechampine.com/blake3 v1.2.2 // indirect
lukechampine.com/uint128 v1.3.0 // indirect
modernc.org/cc/v3 v3.41.0 // indirect
modernc.org/ccgo/v3 v3.16.15 // indirect
modernc.org/libc v1.29.0 // indirect
modernc.org/mathutil v1.6.0 // indirect
modernc.org/memory v1.7.2 // indirect
modernc.org/opt v0.1.3 // indirect
modernc.org/sqlite v1.28.0 // indirect
modernc.org/strutil v1.2.0 // indirect
modernc.org/token v1.1.0 // indirect
nhooyr.io/websocket v1.8.10 // indirect
pgregory.net/rapid v1.1.0 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
)
File diff suppressed because it is too large Load Diff
-137
View File
@@ -1,137 +0,0 @@
package e2e
import (
"context"
"testing"
"cosmossdk.io/math"
transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types"
"github.com/strangelove-ventures/interchaintest/v8"
"github.com/strangelove-ventures/interchaintest/v8/chain/cosmos"
"github.com/strangelove-ventures/interchaintest/v8/ibc"
interchaintestrelayer "github.com/strangelove-ventures/interchaintest/v8/relayer"
"github.com/strangelove-ventures/interchaintest/v8/testreporter"
"github.com/stretchr/testify/require"
"go.uber.org/zap/zapcore"
"go.uber.org/zap/zaptest"
)
const (
ibcPath = "ibc-path"
)
func TestIBC(t *testing.T) {
t.Parallel()
ctx := context.Background()
cfgA := DefaultChainConfig
cfgA.ChainID = cfgA.ChainID + "-1"
cfgB := DefaultChainConfig
cfgB.ChainID = cfgB.ChainID + "-2"
cf := interchaintest.NewBuiltinChainFactory(zaptest.NewLogger(t, zaptest.Level(zapcore.DebugLevel)), []*interchaintest.ChainSpec{
{
Name: DefaultChainConfig.Name,
Version: ChainImage.Version,
ChainName: cfgA.ChainID,
NumValidators: &NumberVals,
NumFullNodes: &NumberFullNodes,
ChainConfig: cfgA,
},
{
Name: DefaultChainConfig.Name,
Version: ChainImage.Version,
ChainName: cfgB.ChainID,
NumValidators: &NumberVals,
NumFullNodes: &NumberFullNodes,
ChainConfig: cfgB,
},
})
chains, err := cf.Chains(t.Name())
require.NoError(t, err)
chainA, chainB := chains[0].(*cosmos.CosmosChain), chains[1].(*cosmos.CosmosChain)
// Relayer Factory
client, network := interchaintest.DockerSetup(t)
rf := interchaintest.NewBuiltinRelayerFactory(
ibc.CosmosRly,
zaptest.NewLogger(t, zaptest.Level(zapcore.DebugLevel)),
interchaintestrelayer.CustomDockerImage(RelayerRepo, RelayerVersion, "100:1000"),
interchaintestrelayer.StartupFlags("--processor", "events", "--block-history", "100"),
)
r := rf.Build(t, client, network)
ic := interchaintest.NewInterchain().
AddChain(chainA).
AddChain(chainB).
AddRelayer(r, "relayer").
AddLink(interchaintest.InterchainLink{
Chain1: chainA,
Chain2: chainB,
Relayer: r,
Path: ibcPath,
})
rep := testreporter.NewNopReporter()
eRep := rep.RelayerExecReporter(t)
// Build interchain
require.NoError(t, ic.Build(ctx, eRep, interchaintest.InterchainBuildOptions{
TestName: t.Name(),
Client: client,
NetworkID: network,
SkipPathCreation: false,
}))
// Create and Fund User Wallets
fundAmount := math.NewInt(10_000_000)
users := interchaintest.GetAndFundTestUsers(t, ctx, "default", fundAmount, chainA, chainB)
userA := users[0]
userB := users[1]
userAInitial, err := chainA.GetBalance(ctx, userA.FormattedAddress(), chainA.Config().Denom)
require.NoError(t, err)
require.True(t, userAInitial.Equal(fundAmount))
// Get Channel ID
aInfo, err := r.GetChannels(ctx, eRep, chainA.Config().ChainID)
require.NoError(t, err)
aChannelID := aInfo[0].ChannelID
bInfo, err := r.GetChannels(ctx, eRep, chainB.Config().ChainID)
require.NoError(t, err)
bChannelID := bInfo[0].ChannelID
// Send Transaction
amountToSend := math.NewInt(1_000_000)
dstAddress := userB.FormattedAddress()
transfer := ibc.WalletAmount{
Address: dstAddress,
Denom: chainA.Config().Denom,
Amount: amountToSend,
}
_, err = chainA.SendIBCTransfer(ctx, aChannelID, userA.KeyName(), transfer, ibc.TransferOptions{})
require.NoError(t, err)
// relay MsgRecvPacket to chainB, then MsgAcknowledgement back to chainA
require.NoError(t, r.Flush(ctx, eRep, ibcPath, aChannelID))
// test source wallet has decreased funds
expectedBal := userAInitial.Sub(amountToSend)
aNewBal, err := chainA.GetBalance(ctx, userA.FormattedAddress(), chainA.Config().Denom)
require.NoError(t, err)
require.True(t, aNewBal.Equal(expectedBal))
// Trace IBC Denom
srcDenomTrace := transfertypes.ParseDenomTrace(transfertypes.GetPrefixedDenom("transfer", bChannelID, chainA.Config().Denom))
dstIbcDenom := srcDenomTrace.IBCDenom()
// Test destination wallet has increased funds
bNewBal, err := chainB.GetBalance(ctx, userB.FormattedAddress(), dstIbcDenom)
require.NoError(t, err)
require.True(t, bNewBal.Equal(amountToSend))
}
-231
View File
@@ -1,231 +0,0 @@
package e2e
import (
"context"
"encoding/json"
"testing"
"time"
"cosmossdk.io/math"
"github.com/strangelove-ventures/interchaintest/v8"
"github.com/strangelove-ventures/interchaintest/v8/chain/cosmos"
"github.com/strangelove-ventures/interchaintest/v8/ibc"
interchaintestrelayer "github.com/strangelove-ventures/interchaintest/v8/relayer"
"github.com/strangelove-ventures/interchaintest/v8/testreporter"
"github.com/strangelove-ventures/interchaintest/v8/testutil"
"github.com/stretchr/testify/require"
"go.uber.org/zap/zaptest"
transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types"
sdk "github.com/cosmos/cosmos-sdk/types"
)
type PacketMetadata struct {
Forward *ForwardMetadata `json:"forward"`
}
type ForwardMetadata struct {
Receiver string `json:"receiver"`
Port string `json:"port"`
Channel string `json:"channel"`
Timeout time.Duration `json:"timeout"`
Retries *uint8 `json:"retries,omitempty"`
Next *string `json:"next,omitempty"`
RefundSequence *uint64 `json:"refund_sequence,omitempty"`
}
func TestPacketForwardMiddleware(t *testing.T) {
if testing.Short() {
t.Skip()
}
var (
ctx = context.Background()
client, network = interchaintest.DockerSetup(t)
rep = testreporter.NewNopReporter()
eRep = rep.RelayerExecReporter(t)
chainID_A, chainID_B, chainID_C = "chain-a", "chain-b", "chain-c"
chainA, chainB, chainC *cosmos.CosmosChain
)
// base config which all networks will use as defaults.
baseCfg := DefaultChainConfig
// Set specific chain ids for each so they are their own unique networks
baseCfg.ChainID = chainID_A
configA := baseCfg
baseCfg.ChainID = chainID_B
configB := baseCfg
baseCfg.ChainID = chainID_C
configC := baseCfg
// Create chain factory with multiple individual networks.
numVals := 1
numFullNodes := 0
cf := interchaintest.NewBuiltinChainFactory(zaptest.NewLogger(t), []*interchaintest.ChainSpec{
{
Name: configA.Name,
ChainConfig: configA,
NumValidators: &numVals,
NumFullNodes: &numFullNodes,
},
{
Name: configA.Name,
ChainConfig: configB,
NumValidators: &numVals,
NumFullNodes: &numFullNodes,
},
{
Name: configA.Name,
ChainConfig: configC,
NumValidators: &numVals,
NumFullNodes: &numFullNodes,
},
})
// Get chains from the chain factory
chains, err := cf.Chains(t.Name())
require.NoError(t, err)
chainA, chainB, chainC = chains[0].(*cosmos.CosmosChain), chains[1].(*cosmos.CosmosChain), chains[2].(*cosmos.CosmosChain)
r := interchaintest.NewBuiltinRelayerFactory(
ibc.CosmosRly,
zaptest.NewLogger(t),
interchaintestrelayer.CustomDockerImage(RelayerRepo, RelayerVersion, "100:1000"),
interchaintestrelayer.StartupFlags("--processor", "events", "--block-history", "100"),
).Build(t, client, network)
const pathAB = "ab"
const pathBC = "bc"
ic := interchaintest.NewInterchain().
AddChain(chainA).
AddChain(chainB).
AddChain(chainC).
AddRelayer(r, "relayer").
AddLink(interchaintest.InterchainLink{
Chain1: chainA,
Chain2: chainB,
Relayer: r,
Path: pathAB,
}).
AddLink(interchaintest.InterchainLink{
Chain1: chainB,
Chain2: chainC,
Relayer: r,
Path: pathBC,
})
require.NoError(t, ic.Build(ctx, eRep, interchaintest.InterchainBuildOptions{
TestName: t.Name(),
Client: client,
NetworkID: network,
BlockDatabaseFile: interchaintest.DefaultBlockDatabaseFilepath(),
SkipPathCreation: false,
}))
t.Cleanup(func() {
_ = ic.Close()
})
users := interchaintest.GetAndFundTestUsers(t, ctx, t.Name(), GenesisFundsAmount, chainA, chainB, chainC)
abChan, err := ibc.GetTransferChannel(ctx, r, eRep, chainID_A, chainID_B)
require.NoError(t, err)
baChan := abChan.Counterparty
cbChan, err := ibc.GetTransferChannel(ctx, r, eRep, chainID_C, chainID_B)
require.NoError(t, err)
bcChan := cbChan.Counterparty
// Start the relayer on all paths
err = r.StartRelayer(ctx, eRep, pathAB, pathBC)
require.NoError(t, err)
t.Cleanup(
func() {
err := r.StopRelayer(ctx, eRep)
if err != nil {
t.Logf("an error occurred while stopping the relayer: %s", err)
}
},
)
// Get original account balances
userA, userB, userC := users[0], users[1], users[2]
var transferAmount math.Int = math.NewInt(100_000)
// Compose the prefixed denoms and ibc denom for asserting balances
firstHopDenom := transfertypes.GetPrefixedDenom(baChan.PortID, baChan.ChannelID, chainA.Config().Denom)
secondHopDenom := transfertypes.GetPrefixedDenom(cbChan.PortID, cbChan.ChannelID, firstHopDenom)
firstHopDenomTrace := transfertypes.ParseDenomTrace(firstHopDenom)
secondHopDenomTrace := transfertypes.ParseDenomTrace(secondHopDenom)
firstHopIBCDenom := firstHopDenomTrace.IBCDenom()
secondHopIBCDenom := secondHopDenomTrace.IBCDenom()
firstHopEscrowAccount := sdk.MustBech32ifyAddressBytes(chainA.Config().Bech32Prefix, transfertypes.GetEscrowAddress(abChan.PortID, abChan.ChannelID))
secondHopEscrowAccount := sdk.MustBech32ifyAddressBytes(chainB.Config().Bech32Prefix, transfertypes.GetEscrowAddress(bcChan.PortID, bcChan.ChannelID))
t.Run("multi-hop a->b->c", func(t *testing.T) {
// Send packet from Chain A->Chain B->Chain C
transfer := ibc.WalletAmount{
Address: userB.FormattedAddress(),
Denom: chainA.Config().Denom,
Amount: transferAmount,
}
firstHopMetadata := &PacketMetadata{
Forward: &ForwardMetadata{
Receiver: userC.FormattedAddress(),
Channel: bcChan.ChannelID,
Port: bcChan.PortID,
},
}
memo, err := json.Marshal(firstHopMetadata)
require.NoError(t, err)
chainAHeight, err := chainA.Height(ctx)
require.NoError(t, err)
transferTx, err := chainA.SendIBCTransfer(ctx, abChan.ChannelID, userA.KeyName(), transfer, ibc.TransferOptions{Memo: string(memo)})
require.NoError(t, err)
_, err = testutil.PollForAck(ctx, chainA, chainAHeight, chainAHeight+30, transferTx.Packet)
require.NoError(t, err)
err = testutil.WaitForBlocks(ctx, 1, chainA)
require.NoError(t, err)
chainABalance, err := chainA.GetBalance(ctx, userA.FormattedAddress(), chainA.Config().Denom)
require.NoError(t, err)
chainBBalance, err := chainB.GetBalance(ctx, userB.FormattedAddress(), firstHopIBCDenom)
require.NoError(t, err)
chainCBalance, err := chainC.GetBalance(ctx, userC.FormattedAddress(), secondHopIBCDenom)
require.NoError(t, err)
require.Equal(t, GenesisFundsAmount.Sub(transferAmount).Int64(), chainABalance.Int64())
require.Equal(t, int64(0), chainBBalance.Int64())
require.Equal(t, int64(100000), chainCBalance.Int64())
firstHopEscrowBalance, err := chainA.GetBalance(ctx, firstHopEscrowAccount, chainA.Config().Denom)
require.NoError(t, err)
secondHopEscrowBalance, err := chainB.GetBalance(ctx, secondHopEscrowAccount, firstHopIBCDenom)
require.NoError(t, err)
require.Equal(t, transferAmount.Int64(), firstHopEscrowBalance.Int64())
require.Equal(t, transferAmount.Int64(), secondHopEscrowBalance.Int64())
})
}
-135
View File
@@ -1,135 +0,0 @@
package e2e
import (
"context"
"fmt"
"testing"
sdk "github.com/cosmos/cosmos-sdk/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
"github.com/strangelove-ventures/interchaintest/v8/chain/cosmos"
"github.com/strangelove-ventures/interchaintest/v8/ibc"
"github.com/strangelove-ventures/poa"
"github.com/stretchr/testify/require"
)
func POASetPower(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain, user ibc.Wallet, valoper string, power int64, flags ...string) (sdk.TxResponse, error) {
cmd := TxCommandBuilder(ctx, chain, []string{"tx", "poa", "set-power", valoper, fmt.Sprintf("%d", power)}, user.KeyName(), flags...)
return ExecuteTransaction(ctx, chain, cmd)
}
func POARemove(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain, user ibc.Wallet, valoper string) (sdk.TxResponse, error) {
cmd := TxCommandBuilder(ctx, chain, []string{"tx", "poa", "remove", valoper}, user.KeyName())
return ExecuteTransaction(ctx, chain, cmd)
}
func POARemovePending(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain, user ibc.Wallet, valoper string) (sdk.TxResponse, error) {
cmd := TxCommandBuilder(ctx, chain, []string{"tx", "poa", "remove-pending", valoper}, user.KeyName())
return ExecuteTransaction(ctx, chain, cmd)
}
func POACreatePendingValidator(
t *testing.T, ctx context.Context, chain *cosmos.CosmosChain, user ibc.Wallet,
ed25519PubKey string, moniker string, commissionRate string, commissionMaxRate string, commissionMaxChangeRate string,
) (sdk.TxResponse, error) {
file := "validator_file.json"
content := fmt.Sprintf(`{
"pubkey": {"@type":"/cosmos.crypto.ed25519.PubKey","key":"%s"},
"amount": "0%s",
"moniker": "%s",
"identity": "",
"website": "https://website.com",
"security": "security@cosmos.xyz",
"details": "description",
"commission-rate": "%s",
"commission-max-rate": "%s",
"commission-max-change-rate": "%s",
"min-self-delegation": "1"
}`, ed25519PubKey, chain.Config().Denom, moniker, commissionRate, commissionMaxRate, commissionMaxChangeRate)
err := chain.GetNode().WriteFile(ctx, []byte(content), file)
require.NoError(t, err)
filePath := fmt.Sprintf("%s/%s", chain.GetNode().HomeDir(), file)
cmd := TxCommandBuilder(ctx, chain, []string{"tx", "poa", "create-validator", filePath}, user.KeyName())
return ExecuteTransaction(ctx, chain, cmd)
}
func SubmitGovernanceProposalForValidatorChanges(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain, user ibc.Wallet, validator string, power uint64, unsafe bool) string {
govAddr := "cosmos10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn"
powerMsg := []cosmos.ProtoMessage{
&poa.MsgSetPower{
Sender: govAddr,
ValidatorAddress: validator,
Power: power,
Unsafe: unsafe,
},
}
title := fmt.Sprintf("Update" + validator + "Power")
desc := fmt.Sprintf("Updating power for validator %s to %d", validator, power)
proposal, err := chain.BuildProposal(powerMsg, title, desc, desc, fmt.Sprintf(`50%s`, chain.Config().Denom), user.FormattedAddress(), false)
require.NoError(t, err, "error building proposal")
fmt.Printf("proposal: %+v\n", proposal)
txProp, err := chain.SubmitProposal(ctx, user.KeyName(), proposal)
t.Log("txProp", txProp)
require.NoError(t, err, "error submitting proposal")
return txProp.ProposalID
}
func GetPOAParams(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain) poa.Params {
var res poa.ParamsResponse
ExecuteQuery(ctx, chain, []string{"query", "poa", "params"}, &res)
return res.Params
}
func GetPOAConsensusPower(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain, valoperAddr string) int64 {
res, err := poa.NewQueryClient(chain.GetNode().GrpcConn).ConsensusPower(ctx, &poa.QueryConsensusPowerRequest{ValidatorAddress: valoperAddr})
require.NoError(t, err)
return res.ConsensusPower
}
func GetPOAPending(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain) []poa.Validator {
res, err := poa.NewQueryClient(chain.GetNode().GrpcConn).PendingValidators(ctx, &poa.QueryPendingValidatorsRequest{})
require.NoError(t, err)
return res.Pending
}
func POAUpdateParams(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain, user ibc.Wallet, admins []string, gracefulExit bool) (sdk.TxResponse, error) {
// admin1,admin2,admin3
adminList := ""
for _, admin := range admins {
adminList += admin + ","
}
adminList = adminList[:len(adminList)-1]
gracefulParam := "true"
if !gracefulExit {
gracefulParam = "false"
}
cmd := TxCommandBuilder(ctx, chain, []string{"tx", "poa", "update-params", adminList, gracefulParam}, user.KeyName())
return ExecuteTransaction(ctx, chain, cmd)
}
func POAUpdateStakingParams(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain, user ibc.Wallet, sp stakingtypes.Params) (sdk.TxResponse, error) {
command := []string{"tx", "poa", "update-staking-params",
sp.UnbondingTime.String(),
fmt.Sprintf("%d", sp.MaxValidators),
fmt.Sprintf("%d", sp.MaxEntries),
fmt.Sprintf("%d", sp.HistoricalEntries),
sp.BondDenom,
fmt.Sprintf("%d", sp.MinCommissionRate),
}
cmd := TxCommandBuilder(ctx, chain, command, user.KeyName())
return ExecuteTransaction(ctx, chain, cmd)
}
-182
View File
@@ -1,182 +0,0 @@
package e2e
import (
"context"
"fmt"
"testing"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
"github.com/strangelove-ventures/interchaintest/v8"
"github.com/strangelove-ventures/interchaintest/v8/chain/cosmos"
"github.com/strangelove-ventures/interchaintest/v8/ibc"
"github.com/strangelove-ventures/interchaintest/v8/testutil"
"github.com/strangelove-ventures/poa"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/stretchr/testify/require"
)
const (
numPOAVals = 2
)
func TestPOA(t *testing.T) {
if testing.Short() {
t.Skip("skipping in short mode")
}
// setup base chain
chains := interchaintest.CreateChainWithConfig(t, numPOAVals, NumberFullNodes, Name, ChainImage.Version, DefaultChainConfig)
chain := chains[0].(*cosmos.CosmosChain)
enableBlockDB := false
ctx, _, _, _ := interchaintest.BuildInitialChain(t, chains, enableBlockDB)
// setup accounts
acc0, err := interchaintest.GetAndFundTestUserWithMnemonic(ctx, "acc0", AccMnemonic, GenesisFundsAmount, chain)
require.NoError(t, err)
acc1, err := interchaintest.GetAndFundTestUserWithMnemonic(ctx, "acc1", Acc1Mnemonic, GenesisFundsAmount, chain)
require.NoError(t, err)
users := interchaintest.GetAndFundTestUsers(t, ctx, t.Name(), GenesisFundsAmount, chain)
incorrectUser := users[0]
// get validator operator addresses
vals, err := chain.StakingQueryValidators(ctx, stakingtypes.Bonded.String())
require.NoError(t, err)
require.Equal(t, len(vals), numPOAVals)
validators := make([]string, len(vals))
for i, v := range vals {
validators[i] = v.OperatorAddress
}
// === Test Cases ===
testStakingDisabled(t, ctx, chain, validators, acc0, acc1)
testPowerErrors(t, ctx, chain, validators, incorrectUser, acc0)
testPending(t, ctx, chain, acc0)
testRemoveValidator(t, ctx, chain, validators, acc0)
}
func testRemoveValidator(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain, validators []string, acc0 ibc.Wallet) {
t.Log("\n===== TEST REMOVE VALIDATOR =====")
powerOne := int64(9_000_000_000_000)
powerTwo := int64(2_500_000)
res, _ := POASetPower(t, ctx, chain, acc0, validators[0], powerOne, "--unsafe")
fmt.Printf("%+v", res)
res, _ = POASetPower(t, ctx, chain, acc0, validators[1], powerTwo, "--unsafe")
fmt.Printf("%+v", res)
// decode res.TxHash into a TxResponse
txRes, err := chain.GetTransaction(res.TxHash)
require.NoError(t, err)
fmt.Printf("%+v", txRes)
if err := testutil.WaitForBlocks(ctx, 2, chain); err != nil {
t.Fatal(err)
}
vals, err := chain.StakingQueryValidators(ctx, stakingtypes.Bonded.String())
require.NoError(t, err)
require.Equal(t, fmt.Sprintf("%d", powerOne), vals[0].Tokens.String())
require.Equal(t, fmt.Sprintf("%d", powerTwo), vals[1].Tokens.String())
// validate the validators both have a conesnsus-power of /1_000_000
p1 := GetPOAConsensusPower(t, ctx, chain, vals[0].OperatorAddress)
require.EqualValues(t, powerOne/1_000_000, p1) // = 9000000
p2 := GetPOAConsensusPower(t, ctx, chain, vals[1].OperatorAddress)
require.EqualValues(t, powerTwo/1_000_000, p2) // = 2
// remove the 2nd validator (lower power)
POARemove(t, ctx, chain, acc0, validators[1])
// allow the poa.BeginBlocker to update new status
if err := testutil.WaitForBlocks(ctx, 5, chain); err != nil {
t.Fatal(err)
}
vals, err = chain.StakingQueryValidators(ctx, stakingtypes.Bonded.String())
require.NoError(t, err)
require.Equal(t, fmt.Sprintf("%d", powerOne), vals[0].Tokens.String())
require.Equal(t, 1, len(vals))
vals, err = chain.StakingQueryValidators(ctx, stakingtypes.Unbonded.String())
require.NoError(t, err)
require.Equal(t, "0", vals[0].Tokens.String())
require.Equal(t, 1, len(vals))
p2 = GetPOAConsensusPower(t, ctx, chain, vals[0].OperatorAddress)
require.EqualValues(t, 0, p2)
}
func testStakingDisabled(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain, validators []string, acc0, acc1 ibc.Wallet) {
t.Log("\n===== TEST STAKING DISABLED =====")
err := chain.GetNode().StakingDelegate(ctx, acc0.KeyName(), validators[0], "1stake")
require.Error(t, err)
require.Contains(t, err.Error(), poa.ErrStakingActionNotAllowed.Error())
granter := acc1
grantee := acc0
// Grant grantee (acc0) the ability to delegate from granter (acc1)
res, err := chain.GetNode().AuthzGrant(ctx, granter, grantee.FormattedAddress(), "generic", "--msg-type", "/cosmos.staking.v1beta1.MsgDelegate")
require.NoError(t, err)
require.EqualValues(t, res.Code, 0)
// Generate nested message
nested := []string{"tx", "staking", "delegate", validators[0], "1stake"}
nestedCmd := TxCommandBuilder(ctx, chain, nested, granter.FormattedAddress())
// Execute nested message via a wrapped Exec
_, err = chain.GetNode().AuthzExec(ctx, grantee, nestedCmd)
require.Error(t, err)
require.Contains(t, err.Error(), poa.ErrStakingActionNotAllowed.Error())
}
func testPending(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain, acc0 ibc.Wallet) {
t.Log("\n===== TEST PENDING =====")
res, _ := POACreatePendingValidator(t, ctx, chain, acc0, "pl3Q8OQwtC7G2dSqRqsUrO5VZul7l40I+MKUcejqRsg=", "testval", "0.10", "0.25", "0.05")
require.EqualValues(t, 0, res.Code)
require.NoError(t, testutil.WaitForBlocks(ctx, 2, chain))
pv := GetPOAPending(t, ctx, chain)
require.Equal(t, 1, len(pv))
require.Equal(t, "0", pv[0].Tokens.String())
require.Equal(t, "1", pv[0].MinSelfDelegation.String())
res, _ = POARemovePending(t, ctx, chain, acc0, pv[0].OperatorAddress)
require.EqualValues(t, 0, res.Code)
// validate it was removed
pv = GetPOAPending(t, ctx, chain)
require.Equal(t, 0, len(pv))
}
func testPowerErrors(t *testing.T, ctx context.Context, chain *cosmos.CosmosChain, validators []string, incorrectUser ibc.Wallet, admin ibc.Wallet) {
t.Log("\n===== TEST POWER ERRORS =====")
var res sdk.TxResponse
var err error
t.Run("fail: set-power message from a non authorized user", func(t *testing.T) {
res, _ = POASetPower(t, ctx, chain, incorrectUser, validators[1], 1_000_000)
res, err := chain.GetTransaction(res.TxHash)
require.NoError(t, err)
require.Contains(t, res.RawLog, poa.ErrNotAnAuthority.Error())
})
t.Run("fail: set-power message below minimum power requirement (self bond)", func(t *testing.T) {
res, err = POASetPower(t, ctx, chain, admin, validators[0], 1)
require.Error(t, err) // cli validate error
require.Contains(t, err.Error(), poa.ErrPowerBelowMinimum.Error())
})
t.Run("fail: set-power message above 30%% without unsafe flag", func(t *testing.T) {
res, _ = POASetPower(t, ctx, chain, admin, validators[0], 9_000_000_000_000_000)
res, err := chain.GetTransaction(res.TxHash)
require.NoError(t, err)
require.Contains(t, res.RawLog, poa.ErrUnsafePower.Error())
})
}
-175
View File
@@ -1,175 +0,0 @@
package e2e
import (
"context"
"encoding/json"
"fmt"
"github.com/cosmos/cosmos-sdk/crypto/keyring"
moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil"
"github.com/strangelove-ventures/interchaintest/v8"
"github.com/strangelove-ventures/interchaintest/v8/chain/cosmos"
"github.com/strangelove-ventures/interchaintest/v8/ibc"
"github.com/strangelove-ventures/interchaintest/v8/testutil"
sdkmath "cosmossdk.io/math"
sdk "github.com/cosmos/cosmos-sdk/types"
globalfee "github.com/strangelove-ventures/globalfee/x/globalfee/types"
poa "github.com/strangelove-ventures/poa"
tokenfactory "github.com/strangelove-ventures/tokenfactory/x/tokenfactory/types"
)
var (
VotingPeriod = "15s"
MaxDepositPeriod = "10s"
Denom = "usnr"
Name = "sonr"
ChainID = "chainid-1"
Binary = "sonrd"
Bech32 = "idx"
NumberVals = 1
NumberFullNodes = 0
GenesisFundsAmount = sdkmath.NewInt(1000_000000) // 1k tokens
ChainImage = ibc.NewDockerImage("core", "local", "1025:1025")
DefaultGenesis = []cosmos.GenesisKV{
// default
cosmos.NewGenesisKV("app_state.gov.params.voting_period", VotingPeriod),
cosmos.NewGenesisKV("app_state.gov.params.max_deposit_period", MaxDepositPeriod),
cosmos.NewGenesisKV("app_state.gov.params.min_deposit.0.denom", Denom),
cosmos.NewGenesisKV("app_state.gov.params.min_deposit.0.amount", "1"),
// poa: gov & testing account
cosmos.NewGenesisKV("app_state.poa.params.admins", []string{"idx10d07y265gmmuvt4z0w9aw880jnsr700j9kqcfa", "idx1hj5fveer5cjtn4wd6wstzugjfdxzl0xpecp0nd"}),
// globalfee: set minimum fee requirements
cosmos.NewGenesisKV("app_state.globalfee.params.minimum_gas_prices", sdk.DecCoins{sdk.NewDecCoinFromDec(Denom, sdkmath.LegacyMustNewDecFromStr("0.0"))}),
// tokenfactory: set create cost in set denom or in gas usage.
cosmos.NewGenesisKV("app_state.tokenfactory.params.denom_creation_fee", nil),
cosmos.NewGenesisKV("app_state.tokenfactory.params.denom_creation_gas_consume", 1), // cost 1 gas to create a new denom
}
DefaultChainConfig = ibc.ChainConfig{
Images: []ibc.DockerImage{
ChainImage,
},
GasAdjustment: 1.5,
ModifyGenesis: cosmos.ModifyGenesis(DefaultGenesis),
EncodingConfig: func() *moduletestutil.TestEncodingConfig {
cfg := cosmos.DefaultEncoding()
// TODO: add encoding types here for the modules you want to use
tokenfactory.RegisterInterfaces(cfg.InterfaceRegistry)
globalfee.RegisterInterfaces(cfg.InterfaceRegistry)
poa.RegisterInterfaces(cfg.InterfaceRegistry)
return &cfg
}(),
Type: "cosmos",
Name: Name,
ChainID: ChainID,
Bin: Binary,
Bech32Prefix: Bech32,
Denom: Denom,
CoinType: "118",
GasPrices: "0" + Denom,
TrustingPeriod: "336h",
}
DefaultChainSpec = interchaintest.ChainSpec{
Name: Name,
ChainName: Name,
Version: ChainImage.Version,
ChainConfig: DefaultChainConfig,
NumValidators: &NumberVals,
NumFullNodes: &NumberFullNodes,
}
// cosmos1hj5fveer5cjtn4wd6wstzugjfdxzl0xpxvjjvr - test_node.sh
AccMnemonic = "decorate bright ozone fork gallery riot bus exhaust worth way bone indoor calm squirrel merry zero scheme cotton until shop any excess stage laundry"
Acc1Mnemonic = "wealth flavor believe regret funny network recall kiss grape useless pepper cram hint member few certain unveil rather brick bargain curious require crowd raise"
RelayerRepo = "ghcr.io/cosmos/relayer"
RelayerVersion = "main"
)
// Other Helpers
func ExecuteQuery(ctx context.Context, chain *cosmos.CosmosChain, cmd []string, i interface{}, extraFlags ...string) {
flags := []string{
"--node", chain.GetRPCAddress(),
"--output=json",
}
flags = append(flags, extraFlags...)
ExecuteExec(ctx, chain, cmd, i, flags...)
}
func ExecuteExec(ctx context.Context, chain *cosmos.CosmosChain, cmd []string, i interface{}, extraFlags ...string) {
command := []string{chain.Config().Bin}
command = append(command, cmd...)
command = append(command, extraFlags...)
fmt.Println(command)
stdout, _, err := chain.Exec(ctx, command, nil)
if err != nil {
fmt.Println(err)
}
fmt.Println(string(stdout))
if err := json.Unmarshal(stdout, &i); err != nil {
fmt.Println(err)
}
}
// Executes a command from CommandBuilder
func ExecuteTransaction(ctx context.Context, chain *cosmos.CosmosChain, cmd []string) (sdk.TxResponse, error) {
var err error
var stdout []byte
stdout, _, err = chain.Exec(ctx, cmd, nil)
if err != nil {
return sdk.TxResponse{}, err
}
if err := testutil.WaitForBlocks(ctx, 2, chain); err != nil {
return sdk.TxResponse{}, err
}
var res sdk.TxResponse
if err := json.Unmarshal(stdout, &res); err != nil {
return res, err
}
return res, err
}
func TxCommandBuilder(ctx context.Context, chain *cosmos.CosmosChain, cmd []string, fromUser string, extraFlags ...string) []string {
return TxCommandBuilderNode(ctx, chain.GetNode(), cmd, fromUser, extraFlags...)
}
func TxCommandBuilderNode(ctx context.Context, node *cosmos.ChainNode, cmd []string, fromUser string, extraFlags ...string) []string {
command := []string{node.Chain.Config().Bin}
command = append(command, cmd...)
command = append(command, "--node", node.Chain.GetRPCAddress())
command = append(command, "--home", node.HomeDir())
command = append(command, "--chain-id", node.Chain.Config().ChainID)
command = append(command, "--from", fromUser)
command = append(command, "--keyring-backend", keyring.BackendTest)
command = append(command, "--output=json")
command = append(command, "--yes")
gasFlag := false
for _, flag := range extraFlags {
if flag == "--gas" {
gasFlag = true
}
}
if !gasFlag {
command = append(command, "--gas", "500000")
}
command = append(command, extraFlags...)
return command
}
-63
View File
@@ -1,63 +0,0 @@
package e2e
import (
"testing"
"github.com/strangelove-ventures/interchaintest/v8"
"github.com/strangelove-ventures/interchaintest/v8/chain/cosmos"
"github.com/stretchr/testify/require"
)
func TestTokenFactory(t *testing.T) {
if testing.Short() {
t.Skip("skipping in short mode")
}
// setup base chain
chains := interchaintest.CreateChainWithConfig(t, NumberVals, NumberFullNodes, Name, ChainImage.Version, DefaultChainConfig)
chain := chains[0].(*cosmos.CosmosChain)
ctx, ic, _, _ := interchaintest.BuildInitialChain(t, chains, false)
users := interchaintest.GetAndFundTestUsers(t, ctx, "default", GenesisFundsAmount, chain, chain)
user := users[0]
user2 := users[1]
uaddr := user.FormattedAddress()
uaddr2 := user2.FormattedAddress()
node := chain.GetNode()
tfDenom, _, err := node.TokenFactoryCreateDenom(ctx, user, "ictestdenom", 2_500_00)
t.Log("TF Denom: ", tfDenom)
require.NoError(t, err)
t.Log("Mint TF Denom to user")
node.TokenFactoryMintDenom(ctx, user.FormattedAddress(), tfDenom, 100)
if balance, err := chain.GetBalance(ctx, uaddr, tfDenom); err != nil {
t.Fatal(err)
} else if balance.Int64() != 100 {
t.Fatal("balance not 100")
}
t.Log("Mint TF Denom to another user")
node.TokenFactoryMintDenomTo(ctx, user.FormattedAddress(), tfDenom, 70, user2.FormattedAddress())
if balance, err := chain.GetBalance(ctx, uaddr2, tfDenom); err != nil {
t.Fatal(err)
} else if balance.Int64() != 70 {
t.Fatal("balance not 70")
}
t.Log("Change admin to uaddr2")
_, err = node.TokenFactoryChangeAdmin(ctx, user.KeyName(), tfDenom, uaddr2)
require.NoError(t, err)
// ensure the admin is the contract
res, err := chain.TokenFactoryQueryAdmin(ctx, tfDenom)
require.NoError(t, err)
require.EqualValues(t, res.AuthorityMetadata.Admin, uaddr2, "admin not uaddr2. Did not properly transfer.")
t.Cleanup(func() {
_ = ic.Close()
})
}
+102
View File
@@ -0,0 +1,102 @@
package context
import (
"regexp"
"strings"
"github.com/labstack/echo/v4"
"github.com/onsonr/sonr/pkg/common"
"github.com/onsonr/sonr/pkg/database/sessions"
"github.com/segmentio/ksuid"
)
// InitSession initializes or loads an existing session
func (s *HTTPContext) InitSession() error {
sessionID := s.getOrCreateSessionID()
// Try to load existing session
var sess sessions.Session
result := s.db.Where("id = ?", sessionID).First(&sess)
if result.Error != nil {
// Create new session if not found
bn, bv, arch, plat, platVer, model := extractBrowserInfo(s.Context)
sess = sessions.Session{
ID: sessionID,
BrowserName: bn,
BrowserVersion: bv,
UserArchitecture: arch,
Platform: plat,
PlatformVersion: platVer,
DeviceModel: model,
}
if err := s.db.Create(&sess).Error; err != nil {
return err
}
}
s.sess = &sess
return nil
}
func (s *HTTPContext) getOrCreateSessionID() string {
if ok := common.CookieExists(s.Context, common.SessionID); !ok {
sessionID := ksuid.New().String()
common.WriteCookie(s.Context, common.SessionID, sessionID)
return sessionID
}
sessionID, err := common.ReadCookie(s.Context, common.SessionID)
if err != nil {
sessionID = ksuid.New().String()
common.WriteCookie(s.Context, common.SessionID, sessionID)
}
return sessionID
}
func extractBrowserInfo(c echo.Context) (string, string, string, string, string, string) {
// Extract all relevant headers
browserName := common.HeaderRead(c, common.UserAgent)
arch := common.HeaderRead(c, common.Architecture)
platform := common.HeaderRead(c, common.Platform)
platformVer := common.HeaderRead(c, common.PlatformVersion)
model := common.HeaderRead(c, common.Model)
fullVersionList := common.HeaderRead(c, common.FullVersionList)
// Default values if headers are empty
if browserName == "" {
browserName = "N/A"
}
if arch == "" {
arch = "unknown"
}
if platform == "" {
platform = "unknown"
}
if platformVer == "" {
platformVer = "unknown"
}
if model == "" {
model = "unknown"
}
// Extract browser version from full version list
version := "-1"
if fullVersionList != "" {
entries := strings.Split(strings.TrimSpace(fullVersionList), ",")
for _, entry := range entries {
entry = strings.TrimSpace(entry)
re := regexp.MustCompile(`"([^"]+)";v="([^"]+)"`)
matches := re.FindStringSubmatch(entry)
if len(matches) == 3 {
browserName = matches[1]
version = matches[2]
if browserName != "Not.A/Brand" &&
browserName != "Chromium" {
break
}
}
}
}
return browserName, version, arch, platform, platformVer, model
}
+53
View File
@@ -0,0 +1,53 @@
package context
import (
"net/http"
"github.com/labstack/echo/v4"
config "github.com/onsonr/sonr/pkg/config/hway"
"github.com/onsonr/sonr/pkg/database/sessions"
"gorm.io/gorm"
)
// Middleware creates a new session middleware
func Middleware(db *gorm.DB, env config.Hway) echo.MiddlewareFunc {
return func(next echo.HandlerFunc) echo.HandlerFunc {
return func(c echo.Context) error {
cc := NewHTTPContext(c, db)
if err := cc.InitSession(); err != nil {
return err
}
return next(cc)
}
}
}
// HTTPContext is the context for HTTP endpoints.
type HTTPContext struct {
echo.Context
db *gorm.DB
sess *sessions.Session
env config.Hway
}
// Get returns the HTTPContext from the echo context
func Get(c echo.Context) (*HTTPContext, error) {
ctx, ok := c.(*HTTPContext)
if !ok {
return nil, echo.NewHTTPError(http.StatusInternalServerError, "Session Context not found")
}
return ctx, nil
}
// NewHTTPContext creates a new session context
func NewHTTPContext(c echo.Context, db *gorm.DB) *HTTPContext {
return &HTTPContext{
Context: c,
db: db,
}
}
// Session returns the current session
func (s *HTTPContext) Session() *sessions.Session {
return s.sess
}
@@ -1,8 +1,8 @@
package session
package context
import (
"github.com/labstack/echo/v4"
"github.com/onsonr/sonr/pkg/gateway/internal/database"
"github.com/onsonr/sonr/pkg/database/sessions"
)
// ╭───────────────────────────────────────────────────────╮
@@ -160,7 +160,7 @@ func HandleExists(c echo.Context, handle string) (bool, error) {
}
var count int64
if err := sess.db.Model(&database.Session{}).Where("user_handle = ?", handle).Count(&count).Error; err != nil {
if err := sess.db.Model(&sessions.Session{}).Where("user_handle = ?", handle).Count(&count).Error; err != nil {
return false, err
}
+36
View File
@@ -0,0 +1,36 @@
package index
import (
"github.com/labstack/echo/v4"
"github.com/onsonr/sonr/internal/gateway/context"
)
// Initial users have no authorization, user handle, or vault address
func isInitial(c echo.Context) bool {
sess, err := context.Get(c)
if err != nil {
return false
}
data := sess.Session()
return data.UserHandle == "" && data.VaultAddress == ""
}
// Expired users have either a user handle or vault address
func isExpired(c echo.Context) bool {
sess, err := context.Get(c)
if err != nil {
return false
}
data := sess.Session()
return data.UserHandle != "" || data.VaultAddress != ""
}
// Returning users have a valid authorization, and either a user handle or vault address
func isReturning(c echo.Context) bool {
sess, err := context.Get(c)
if err != nil {
return false
}
data := sess.Session()
return data.UserHandle != "" && data.VaultAddress != ""
}
@@ -0,0 +1,13 @@
package index
import (
"github.com/labstack/echo/v4"
"github.com/onsonr/sonr/pkg/common/response"
)
func Handler(c echo.Context) error {
if isExpired(c) {
return response.TemplEcho(c, ReturningView())
}
return response.TemplEcho(c, InitialView())
}
@@ -0,0 +1,48 @@
package index
import (
"github.com/onsonr/sonr/internal/nebula/card"
"github.com/onsonr/sonr/internal/nebula/layout"
"github.com/onsonr/sonr/internal/nebula/text"
)
templ InitialView() {
@layout.View("Sonr.ID") {
@card.Container() {
@text.TitleDescription("Sonr.ID", "The decentralized identity layer for the web.")
<div class="pt-1.5 mb-3 flex flex-col items-center justify-center h-full">
<sl-button size="large" hx-target="#container" hx-get="/register" hx-push-url="/register" type="button">
<sl-icon slot="prefix" library="sonr" name="sonr"></sl-icon>
Get Started
<sl-icon slot="suffix" library="sonr" name="arrow-right"></sl-icon>
</sl-button>
</div>
<div class="pt-1.5 flex flex-row items-center justify-center h-full gap-3">
<sl-button circle outline href="https://sonr.io">
<sl-icon name="home" library="sonr" label="Home"></sl-icon>
</sl-button>
<sl-button circle outline href="https://onsonr.dev">
<sl-icon name="docs" library="sonr" label="Docs"></sl-icon>
</sl-button>
<sl-button circle outline href="https://github.com/onsonr/sonr">
<sl-icon name="social-github" library="sonr" label="Open Source"></sl-icon>
</sl-button>
</div>
}
}
}
templ ReturningView() {
@layout.View("Login | Sonr.ID") {
@card.Container() {
@text.TitleDescription("Welcome Back!", "Continue with your existing Sonr.ID.")
<div class="pt-3 flex flex-col items-center justify-center h-full">
<sl-button hx-target="#container" hx-get="/register" type="button">
<sl-icon slot="prefix" library="sonr" name="sonr"></sl-icon>
Log back in
<sl-icon slot="suffix" library="sonr" name="arrow-right"></sl-icon>
</sl-button>
</div>
}
}
}
@@ -9,8 +9,9 @@ import "github.com/a-h/templ"
import templruntime "github.com/a-h/templ/runtime"
import (
"github.com/onsonr/sonr/pkg/styles/layout"
"github.com/onsonr/sonr/pkg/styles/text"
"github.com/onsonr/sonr/internal/nebula/card"
"github.com/onsonr/sonr/internal/nebula/layout"
"github.com/onsonr/sonr/internal/nebula/text"
)
func InitialView() templ.Component {
@@ -58,23 +59,23 @@ func InitialView() templ.Component {
}()
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Err = text.Header("Sonr.ID", "The decentralized identity layer for the web.").Render(ctx, templ_7745c5c3_Buffer)
templ_7745c5c3_Err = text.TitleDescription("Sonr.ID", "The decentralized identity layer for the web.").Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" <div class=\"pt-3 flex flex-col items-center justify-center h-full\"><sl-button hx-target=\"#container\" hx-get=\"/register\" hx-push-url=\"/register\" type=\"button\"><sl-icon slot=\"prefix\" library=\"sonr\" name=\"sonr\"></sl-icon> Get Started <sl-icon slot=\"suffix\" library=\"sonr\" name=\"arrow-right\"></sl-icon></sl-button></div>")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" <div class=\"pt-1.5 mb-3 flex flex-col items-center justify-center h-full\"><sl-button size=\"large\" hx-target=\"#container\" hx-get=\"/register\" hx-push-url=\"/register\" type=\"button\"><sl-icon slot=\"prefix\" library=\"sonr\" name=\"sonr\"></sl-icon> Get Started <sl-icon slot=\"suffix\" library=\"sonr\" name=\"arrow-right\"></sl-icon></sl-button></div><div class=\"pt-1.5 flex flex-row items-center justify-center h-full gap-3\"><sl-button circle outline href=\"https://sonr.io\"><sl-icon name=\"home\" library=\"sonr\" label=\"Home\"></sl-icon></sl-button> <sl-button circle outline href=\"https://onsonr.dev\"><sl-icon name=\"docs\" library=\"sonr\" label=\"Docs\"></sl-icon></sl-button> <sl-button circle outline href=\"https://github.com/onsonr/sonr\"><sl-icon name=\"social-github\" library=\"sonr\" label=\"Open Source\"></sl-icon></sl-button></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
return templ_7745c5c3_Err
})
templ_7745c5c3_Err = layout.Container().Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer)
templ_7745c5c3_Err = card.Container().Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
return templ_7745c5c3_Err
})
templ_7745c5c3_Err = layout.Root("Welcome | Sonr.ID").Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer)
templ_7745c5c3_Err = layout.View("Sonr.ID").Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -127,7 +128,7 @@ func ReturningView() templ.Component {
}()
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Err = text.Header("Welcome Back!", "Continue with your existing Sonr.ID.").Render(ctx, templ_7745c5c3_Buffer)
templ_7745c5c3_Err = text.TitleDescription("Welcome Back!", "Continue with your existing Sonr.ID.").Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -137,13 +138,13 @@ func ReturningView() templ.Component {
}
return templ_7745c5c3_Err
})
templ_7745c5c3_Err = layout.Container().Render(templ.WithChildren(ctx, templ_7745c5c3_Var6), templ_7745c5c3_Buffer)
templ_7745c5c3_Err = card.Container().Render(templ.WithChildren(ctx, templ_7745c5c3_Var6), templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
return templ_7745c5c3_Err
})
templ_7745c5c3_Err = layout.Root("Login | Sonr.ID").Render(templ.WithChildren(ctx, templ_7745c5c3_Var5), templ_7745c5c3_Buffer)
templ_7745c5c3_Err = layout.View("Login | Sonr.ID").Render(templ.WithChildren(ctx, templ_7745c5c3_Var5), templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -0,0 +1,84 @@
package register
import (
"encoding/json"
"fmt"
"net/http"
"github.com/labstack/echo/v4"
"golang.org/x/exp/rand"
)
// Define the credential structure matching our frontend data
type Credential struct {
Handle string `json:"handle"`
ID string `json:"id"`
RawID string `json:"rawId"`
Type string `json:"type"`
AuthenticatorAttachment string `json:"authenticatorAttachment"`
Transports string `json:"transports"`
ClientExtensionResults map[string]string `json:"clientExtensionResults"`
Response struct {
AttestationObject string `json:"attestationObject"`
ClientDataJSON string `json:"clientDataJSON"`
} `json:"response"`
}
type CreateProfileData struct {
TurnstileSiteKey string
FirstNumber int
LastNumber int
}
type RegisterPasskeyData struct {
Address string
Handle string
Name string
Challenge string
CreationBlock string
}
func (d CreateProfileData) IsHumanLabel() string {
return fmt.Sprintf("What is %d + %d?", d.FirstNumber, d.LastNumber)
}
func extractCredentialDescriptor(jsonString string) (*Credential, error) {
cred := &Credential{}
// Unmarshal the credential JSON
if err := json.Unmarshal([]byte(jsonString), cred); err != nil {
return nil, echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("invalid credential format: %v", err))
}
// Validate required fields
if cred.ID == "" || cred.RawID == "" {
return nil, echo.NewHTTPError(http.StatusBadRequest, "missing credential ID")
}
if cred.Type != "public-key" {
return nil, echo.NewHTTPError(http.StatusBadRequest, "invalid credential type")
}
if cred.Response.AttestationObject == "" || cred.Response.ClientDataJSON == "" {
return nil, echo.NewHTTPError(http.StatusBadRequest, "missing attestation data")
}
// Log detailed credential information
fmt.Printf("Credential Details:\n"+
"ID: %s\n"+
"Raw ID: %s\n"+
"Type: %s\n"+
"Authenticator Attachment: %s\n"+
"Transports: %v\n"+
cred.ID,
cred.RawID,
cred.Type,
cred.AuthenticatorAttachment,
cred.Transports,
)
return cred, nil
}
func randomCreateProfileData() CreateProfileData {
return CreateProfileData{
FirstNumber: rand.Intn(5) + 1,
LastNumber: rand.Intn(4) + 1,
}
}
@@ -0,0 +1,51 @@
package register
import (
"github.com/onsonr/sonr/internal/nebula/card"
"github.com/onsonr/sonr/internal/nebula/form"
"github.com/onsonr/sonr/internal/nebula/input"
)
templ formCreateProfile(action string, method string, data CreateProfileData) {
@form.Root(action, method, "create-profile") {
@form.Body() {
@form.Header() {
<sl-progress-bar value="50"></sl-progress-bar>
}
@input.Name()
@input.Handle()
@input.HumanSlider(data.FirstNumber, data.LastNumber)
@form.Footer() {
@form.CancelButton()
@form.SubmitButton("Next")
}
}
}
}
templ formRegisterPasskey(action, method string, data RegisterPasskeyData) {
<form action={ templ.SafeURL(action) } method={ method } id="passkey-form">
<input type="hidden" name="credential" id="credential-data" required/>
<sl-card class="card-form gap-4 max-w-xl">
<div slot="header">
<div class="w-full py-2">
@card.SonrProfile(data.Address, data.Name, data.Handle, data.CreationBlock)
</div>
</div>
@input.CoinSelect()
<div slot="footer" class="space-y-2">
@input.Passkey(data.Address, data.Handle, data.Challenge)
<sl-button href="/" style="width: 100%;" outline>
<sl-icon slot="prefix" name="x-lg"></sl-icon>
Cancel
</sl-button>
</div>
<style>
.card-form [slot='footer'] {
justify-content: space-evenly;
align-items: center;
}
</style>
</sl-card>
</form>
}
@@ -0,0 +1,233 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.793
package register
//lint:file-ignore SA4006 This context is only used if a nested component is present.
import "github.com/a-h/templ"
import templruntime "github.com/a-h/templ/runtime"
import (
"github.com/onsonr/sonr/internal/nebula/card"
"github.com/onsonr/sonr/internal/nebula/form"
"github.com/onsonr/sonr/internal/nebula/input"
)
func formCreateProfile(action string, method string, data CreateProfileData) templ.Component {
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
return templ_7745c5c3_CtxErr
}
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
if !templ_7745c5c3_IsBuffer {
defer func() {
templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
if templ_7745c5c3_Err == nil {
templ_7745c5c3_Err = templ_7745c5c3_BufErr
}
}()
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var1 := templ.GetChildren(ctx)
if templ_7745c5c3_Var1 == nil {
templ_7745c5c3_Var1 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
templ_7745c5c3_Var2 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
if !templ_7745c5c3_IsBuffer {
defer func() {
templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
if templ_7745c5c3_Err == nil {
templ_7745c5c3_Err = templ_7745c5c3_BufErr
}
}()
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var3 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
if !templ_7745c5c3_IsBuffer {
defer func() {
templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
if templ_7745c5c3_Err == nil {
templ_7745c5c3_Err = templ_7745c5c3_BufErr
}
}()
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var4 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
if !templ_7745c5c3_IsBuffer {
defer func() {
templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
if templ_7745c5c3_Err == nil {
templ_7745c5c3_Err = templ_7745c5c3_BufErr
}
}()
}
ctx = templ.InitializeContext(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<sl-progress-bar value=\"50\"></sl-progress-bar>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
return templ_7745c5c3_Err
})
templ_7745c5c3_Err = form.Header().Render(templ.WithChildren(ctx, templ_7745c5c3_Var4), templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = input.Name().Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = input.Handle().Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = input.HumanSlider(data.FirstNumber, data.LastNumber).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Var5 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
if !templ_7745c5c3_IsBuffer {
defer func() {
templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
if templ_7745c5c3_Err == nil {
templ_7745c5c3_Err = templ_7745c5c3_BufErr
}
}()
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Err = form.CancelButton().Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = form.SubmitButton("Next").Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
return templ_7745c5c3_Err
})
templ_7745c5c3_Err = form.Footer().Render(templ.WithChildren(ctx, templ_7745c5c3_Var5), templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
return templ_7745c5c3_Err
})
templ_7745c5c3_Err = form.Body().Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
return templ_7745c5c3_Err
})
templ_7745c5c3_Err = form.Root(action, method, "create-profile").Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
return templ_7745c5c3_Err
})
}
func formRegisterPasskey(action, method string, data RegisterPasskeyData) templ.Component {
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
return templ_7745c5c3_CtxErr
}
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
if !templ_7745c5c3_IsBuffer {
defer func() {
templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
if templ_7745c5c3_Err == nil {
templ_7745c5c3_Err = templ_7745c5c3_BufErr
}
}()
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var6 := templ.GetChildren(ctx)
if templ_7745c5c3_Var6 == nil {
templ_7745c5c3_Var6 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<form action=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var7 templ.SafeURL = templ.SafeURL(action)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var7)))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" method=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var8 string
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(method)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/gateway/handlers/register/forms.templ`, Line: 27, Col: 55}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" id=\"passkey-form\"><input type=\"hidden\" name=\"credential\" id=\"credential-data\" required> <sl-card class=\"card-form gap-4 max-w-xl\"><div slot=\"header\"><div class=\"w-full py-2\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = card.SonrProfile(data.Address, data.Name, data.Handle, data.CreationBlock).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = input.CoinSelect().Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div slot=\"footer\" class=\"space-y-2\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = input.Passkey(data.Address, data.Handle, data.Challenge).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<sl-button href=\"/\" style=\"width: 100%;\" outline><sl-icon slot=\"prefix\" name=\"x-lg\"></sl-icon> Cancel</sl-button></div><style>\n \t\t.card-form [slot='footer'] {\n \t\tjustify-content: space-evenly;\n \t\talign-items: center;\n \t\t}\n\t\t</style></sl-card></form>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
return templ_7745c5c3_Err
})
}
var _ = templruntime.GeneratedTemplate
@@ -0,0 +1,49 @@
package register
import (
"fmt"
"net/http"
"github.com/go-webauthn/webauthn/protocol"
"github.com/labstack/echo/v4"
"github.com/onsonr/sonr/crypto/mpc"
"github.com/onsonr/sonr/pkg/common/response"
)
func HandleCreateProfile(c echo.Context) error {
d := randomCreateProfileData()
return response.TemplEcho(c, ProfileFormView(d))
}
func HandlePasskeyStart(c echo.Context) error {
challenge, _ := protocol.CreateChallenge()
handle := c.FormValue("handle")
firstName := c.FormValue("first_name")
lastName := c.FormValue("last_name")
ks, err := mpc.NewKeyset()
if err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, err.Error())
}
dat := RegisterPasskeyData{
Address: ks.Address(),
Handle: handle,
Name: fmt.Sprintf("%s %s", firstName, lastName),
Challenge: challenge.String(),
CreationBlock: "00001",
}
return response.TemplEcho(c, LinkCredentialView(dat))
}
func HandlePasskeyFinish(c echo.Context) error {
// Get the raw credential JSON string
credentialJSON := c.FormValue("credential")
if credentialJSON == "" {
return echo.NewHTTPError(http.StatusBadRequest, "missing credential data")
}
_, err := extractCredentialDescriptor(credentialJSON)
if err != nil {
return err
}
return response.TemplEcho(c, LoadingVaultView())
}
@@ -0,0 +1,33 @@
package register
import (
"github.com/onsonr/sonr/internal/nebula/card"
"github.com/onsonr/sonr/internal/nebula/layout"
"github.com/onsonr/sonr/internal/nebula/text"
)
templ ProfileFormView(data CreateProfileData) {
@layout.View("New Profile | Sonr.ID") {
@card.Container() {
@text.TitleDescription("Basic Info", "Tell us a little about yourself.")
@formCreateProfile("/register/start", "POST", data)
}
}
}
templ LinkCredentialView(data RegisterPasskeyData) {
@layout.View("Register | Sonr.ID") {
@card.Container() {
@text.TitleDescription("Link a PassKey", "This will be used to login to your vault.")
@formRegisterPasskey("/register/finish", "POST", data)
}
}
}
templ LoadingVaultView() {
@layout.View("Loading... | Sonr.ID") {
@card.Container() {
@text.TitleDescription("Loading Vault", "This will be used to login to your vault.")
}
}
}
@@ -9,13 +9,12 @@ import "github.com/a-h/templ"
import templruntime "github.com/a-h/templ/runtime"
import (
"github.com/onsonr/sonr/pkg/styles/details"
"github.com/onsonr/sonr/pkg/styles/form"
"github.com/onsonr/sonr/pkg/styles/layout"
"github.com/onsonr/sonr/pkg/styles/text"
"github.com/onsonr/sonr/internal/nebula/card"
"github.com/onsonr/sonr/internal/nebula/layout"
"github.com/onsonr/sonr/internal/nebula/text"
)
func ProfileFormView(turnstileSiteKey string) templ.Component {
func ProfileFormView(data CreateProfileData) templ.Component {
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
@@ -60,61 +59,27 @@ func ProfileFormView(turnstileSiteKey string) templ.Component {
}()
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Err = text.Header("Create a Profile", "Enter some basic information about yourself.").Render(ctx, templ_7745c5c3_Buffer)
templ_7745c5c3_Err = text.TitleDescription("Basic Info", "Tell us a little about yourself.").Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" <br>")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Var4 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
if !templ_7745c5c3_IsBuffer {
defer func() {
templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
if templ_7745c5c3_Err == nil {
templ_7745c5c3_Err = templ_7745c5c3_BufErr
}
}()
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Err = form.NameInput().Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" <br>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = form.HandleInput().Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = form.TurnstileWidget(turnstileSiteKey).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
return templ_7745c5c3_Err
})
templ_7745c5c3_Err = form.Form("/register/start", "POST", form.Submit("Continue"), "25", true).Render(templ.WithChildren(ctx, templ_7745c5c3_Var4), templ_7745c5c3_Buffer)
templ_7745c5c3_Err = formCreateProfile("/register/start", "POST", data).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
return templ_7745c5c3_Err
})
templ_7745c5c3_Err = layout.Container().Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer)
templ_7745c5c3_Err = card.Container().Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
return templ_7745c5c3_Err
})
templ_7745c5c3_Err = layout.Root("Sonr.ID").Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer)
templ_7745c5c3_Err = layout.View("New Profile | Sonr.ID").Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -122,7 +87,7 @@ func ProfileFormView(turnstileSiteKey string) templ.Component {
})
}
func LinkCredentialView(req LinkCredentialRequest) templ.Component {
func LinkCredentialView(data RegisterPasskeyData) templ.Component {
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
@@ -138,12 +103,12 @@ func LinkCredentialView(req LinkCredentialRequest) templ.Component {
}()
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var5 := templ.GetChildren(ctx)
if templ_7745c5c3_Var5 == nil {
templ_7745c5c3_Var5 = templ.NopComponent
templ_7745c5c3_Var4 := templ.GetChildren(ctx)
if templ_7745c5c3_Var4 == nil {
templ_7745c5c3_Var4 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
templ_7745c5c3_Var6 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_Var5 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
if !templ_7745c5c3_IsBuffer {
@@ -155,7 +120,7 @@ func LinkCredentialView(req LinkCredentialRequest) templ.Component {
}()
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var7 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_Var6 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
if !templ_7745c5c3_IsBuffer {
@@ -167,87 +132,27 @@ func LinkCredentialView(req LinkCredentialRequest) templ.Component {
}()
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Err = text.Header("Link a PassKey", "This will be used to login to your vault.").Render(ctx, templ_7745c5c3_Buffer)
templ_7745c5c3_Err = text.TitleDescription("Link a PassKey", "This will be used to login to your vault.").Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" <br>")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Var8 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
if !templ_7745c5c3_IsBuffer {
defer func() {
templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
if templ_7745c5c3_Err == nil {
templ_7745c5c3_Err = templ_7745c5c3_BufErr
}
}()
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var9 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
if !templ_7745c5c3_IsBuffer {
defer func() {
templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
if templ_7745c5c3_Err == nil {
templ_7745c5c3_Err = templ_7745c5c3_BufErr
}
}()
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Err = details.Property("Address", req.Address, "wallet").Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = details.Property("Handle", req.Handle, "at-sign").Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = details.Property("Platform", req.Platform, "device-iphone").Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = details.Property("Model", req.DeviceModel, "laptop").Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
return templ_7745c5c3_Err
})
templ_7745c5c3_Err = details.PropertyList().Render(templ.WithChildren(ctx, templ_7745c5c3_Var9), templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
return templ_7745c5c3_Err
})
templ_7745c5c3_Err = form.Form("/register/finish", "POST", form.PasskeyInput("passkey"), "65", false).Render(templ.WithChildren(ctx, templ_7745c5c3_Var8), templ_7745c5c3_Buffer)
templ_7745c5c3_Err = formRegisterPasskey("/register/finish", "POST", data).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
return templ_7745c5c3_Err
})
templ_7745c5c3_Err = layout.Container().Render(templ.WithChildren(ctx, templ_7745c5c3_Var7), templ_7745c5c3_Buffer)
templ_7745c5c3_Err = card.Container().Render(templ.WithChildren(ctx, templ_7745c5c3_Var6), templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
return templ_7745c5c3_Err
})
templ_7745c5c3_Err = layout.Root("Sonr.ID").Render(templ.WithChildren(ctx, templ_7745c5c3_Var6), templ_7745c5c3_Buffer)
templ_7745c5c3_Err = layout.View("Register | Sonr.ID").Render(templ.WithChildren(ctx, templ_7745c5c3_Var5), templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -271,12 +176,12 @@ func LoadingVaultView() templ.Component {
}()
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var10 := templ.GetChildren(ctx)
if templ_7745c5c3_Var10 == nil {
templ_7745c5c3_Var10 = templ.NopComponent
templ_7745c5c3_Var7 := templ.GetChildren(ctx)
if templ_7745c5c3_Var7 == nil {
templ_7745c5c3_Var7 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
templ_7745c5c3_Var11 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_Var8 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
if !templ_7745c5c3_IsBuffer {
@@ -288,7 +193,7 @@ func LoadingVaultView() templ.Component {
}()
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var12 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_Var9 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
if !templ_7745c5c3_IsBuffer {
@@ -300,19 +205,19 @@ func LoadingVaultView() templ.Component {
}()
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Err = text.Header("Loading Vault", "This will be used to login to your vault.").Render(ctx, templ_7745c5c3_Buffer)
templ_7745c5c3_Err = text.TitleDescription("Loading Vault", "This will be used to login to your vault.").Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
return templ_7745c5c3_Err
})
templ_7745c5c3_Err = layout.Container().Render(templ.WithChildren(ctx, templ_7745c5c3_Var12), templ_7745c5c3_Buffer)
templ_7745c5c3_Err = card.Container().Render(templ.WithChildren(ctx, templ_7745c5c3_Var9), templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
return templ_7745c5c3_Err
})
templ_7745c5c3_Err = layout.Root("Sonr.ID").Render(templ.WithChildren(ctx, templ_7745c5c3_Var11), templ_7745c5c3_Buffer)
templ_7745c5c3_Err = layout.View("Loading... | Sonr.ID").Render(templ.WithChildren(ctx, templ_7745c5c3_Var8), templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
+27
View File
@@ -0,0 +1,27 @@
// Package gateway provides the default routes for the Sonr hway.
package gateway
import (
"github.com/labstack/echo/v4"
"github.com/onsonr/sonr/internal/gateway/context"
"github.com/onsonr/sonr/internal/gateway/handlers/index"
"github.com/onsonr/sonr/internal/gateway/handlers/register"
"github.com/onsonr/sonr/pkg/common/response"
config "github.com/onsonr/sonr/pkg/config/hway"
"gorm.io/gorm"
)
func RegisterRoutes(e *echo.Echo, env config.Hway, db *gorm.DB) error {
// Custom error handler for gateway
e.HTTPErrorHandler = response.RedirectOnError("http://localhost:3000")
// Inject session middleware with database connection
e.Use(context.Middleware(db, env))
// Register routes
e.GET("/", index.Handler)
e.GET("/register", register.HandleCreateProfile)
e.POST("/register/start", register.HandlePasskeyStart)
e.POST("/register/finish", register.HandlePasskeyFinish)
return nil
}
+13
View File
@@ -0,0 +1,13 @@
package card
templ Container() {
<div id="container" class="flex fixed inset-0 z-[99] w-screen min-h-screen">
<div class="relative flex flex-wrap items-center w-full min-h-full px-4 py-6 sm:px-6 md:px-8">
<div class="relative w-full max-w-screen-lg mx-auto">
<div class="flex flex-col items-center justify-center min-h-full gap-4">
{ children... }
</div>
</div>
</div>
</div>
}
@@ -1,14 +1,14 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.793
package internal
package card
//lint:file-ignore SA4006 This context is only used if a nested component is present.
import "github.com/a-h/templ"
import templruntime "github.com/a-h/templ/runtime"
func ProfileForm() templ.Component {
func Container() templ.Component {
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
@@ -29,7 +29,15 @@ func ProfileForm() templ.Component {
templ_7745c5c3_Var1 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"relative w-full max-w-sm mx-auto lg:mb-0\"><div class=\"relative text-center\"><div class=\"flex flex-col mb-6 space-y-2\"><span><wa-qr-code size=\"140\" value=\"https://shoelace.style/\"></wa-qr-code></span><h1 class=\"text-2xl lg:text-3xl font-bold pb-3\"><span>Shoelace</span></h1><p class=\"text-lg text-zinc-500\">A lightweight library for building accessible, high-performance UI components with no dependencies.</p></div><div class=\"max-w-xs mx-auto sm:max-w-none sm:inline-flex sm:justify-center space-y-4 sm:space-y-0 sm:space-x-4\"><button class=\"inline-flex items-center justify-center w-full h-10 px-4 py-2 text-sm font-medium text-white transition-colors duration-200 rounded-md bg-neutral-950 hover:bg-neutral-900 focus:ring-2 focus:ring-offset-2 focus:ring-neutral-900\">Get started</button></div></div></div>")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"container\" class=\"flex fixed inset-0 z-[99] w-screen min-h-screen\"><div class=\"relative flex flex-wrap items-center w-full min-h-full px-4 py-6 sm:px-6 md:px-8\"><div class=\"relative w-full max-w-screen-lg mx-auto\"><div class=\"flex flex-col items-center justify-center min-h-full gap-4\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></div></div></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
+38
View File
@@ -0,0 +1,38 @@
package card
templ SonrProfile(addr, name, handle, creationBlock string) {
<div class="profile-card min-w-[320px]">
<div class="text-white max-w-xs my-auto mx-auto bg-gradient-to-r from-cyan-700 to-cyan-300 p-4 py-5 px-5 rounded-xl">
<div class="flex justify-between">
<div>
<h2>sonr-testnet-1</h2>
<p class="text-2xl font-bold">{ handle }</p>
</div>
<div class="flex items-center opacity-60">
<sl-icon style="font-size: 52px;" library="sonr" name="sonr-fill"></sl-icon>
</div>
</div>
<div class="mt-5 flex justify-between items-center w-52">
<span class="text-lg font-mono">{ shortenAddress(addr) }</span>
</div>
<div class="flex justify-between mt-5 w-48 ">
<div>
<h3 class="text-xs">Block Created </h3>
<p class="font-bold"><span>#</span>{ creationBlock }</p>
</div>
<div>
<h3 class="text-xs">Issued to</h3>
<p class="font-bold">{ name }</p>
</div>
</div>
</div>
</div>
}
// Helper function to shorten address
func shortenAddress(address string) string {
if len(address) <= 20 {
return address
}
return address[:16] + "..." + address[len(address)-4:]
}
+100
View File
@@ -0,0 +1,100 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.793
package card
//lint:file-ignore SA4006 This context is only used if a nested component is present.
import "github.com/a-h/templ"
import templruntime "github.com/a-h/templ/runtime"
func SonrProfile(addr, name, handle, creationBlock string) templ.Component {
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
return templ_7745c5c3_CtxErr
}
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
if !templ_7745c5c3_IsBuffer {
defer func() {
templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
if templ_7745c5c3_Err == nil {
templ_7745c5c3_Err = templ_7745c5c3_BufErr
}
}()
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var1 := templ.GetChildren(ctx)
if templ_7745c5c3_Var1 == nil {
templ_7745c5c3_Var1 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"profile-card min-w-[320px]\"><div class=\"text-white max-w-xs my-auto mx-auto bg-gradient-to-r from-cyan-700 to-cyan-300 p-4 py-5 px-5 rounded-xl\"><div class=\"flex justify-between\"><div><h2>sonr-testnet-1</h2><p class=\"text-2xl font-bold\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var2 string
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(handle)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/nebula/card/sonr_profile.templ`, Line: 9, Col: 43}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</p></div><div class=\"flex items-center opacity-60\"><sl-icon style=\"font-size: 52px;\" library=\"sonr\" name=\"sonr-fill\"></sl-icon></div></div><div class=\"mt-5 flex justify-between items-center w-52\"><span class=\"text-lg font-mono\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var3 string
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(shortenAddress(addr))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/nebula/card/sonr_profile.templ`, Line: 16, Col: 58}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</span></div><div class=\"flex justify-between mt-5 w-48 \"><div><h3 class=\"text-xs\">Block Created </h3><p class=\"font-bold\"><span>#</span>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var4 string
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(creationBlock)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/nebula/card/sonr_profile.templ`, Line: 21, Col: 55}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</p></div><div><h3 class=\"text-xs\">Issued to</h3><p class=\"font-bold\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var5 string
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(name)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/nebula/card/sonr_profile.templ`, Line: 25, Col: 32}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</p></div></div></div></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
return templ_7745c5c3_Err
})
}
// Helper function to shorten address
func shortenAddress(address string) string {
if len(address) <= 20 {
return address
}
return address[:16] + "..." + address[len(address)-4:]
}
var _ = templruntime.GeneratedTemplate
+58
View File
@@ -0,0 +1,58 @@
package form
templ Root(action, method, id string) {
<form action={ templ.SafeURL(action) } method={ method } id={ id }>
{ children... }
</form>
}
templ Header() {
<div slot="header">
<div class="w-full py-2">
{ children... }
</div>
</div>
}
templ Body() {
<sl-card class="card-form max-w-lg mx-auto">
{ children... }
<style>
.card-form {
space-y: 1rem;
}
.card-form [slot='header'] {
display: flex;
align-items: center;
justify-content: space-between;
}
.card-form [slot='footer'] {
display: flex;
justify-content: space-between;
align-items: center;
}
</style>
</sl-card>
}
templ Footer() {
<div slot="footer">
{ children... }
</div>
}
templ CancelButton() {
<sl-button href="/" outline>
<sl-icon slot="prefix" name="x-lg"></sl-icon>
Cancel
</sl-button>
}
templ SubmitButton(text string) {
<sl-button type="submit">
{ text }
<sl-icon slot="suffix" name="arrow-right" library="sonr"></sl-icon>
</sl-button>
}
@@ -8,10 +8,7 @@ package form
import "github.com/a-h/templ"
import templruntime "github.com/a-h/templ/runtime"
import "github.com/onsonr/sonr/pkg/styles/layout"
// Form is a standard form styled like a card
func Form(action string, method string, submit templ.Component, progress string, enableCancel bool) templ.Component {
func Root(action, method, id string) templ.Component {
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
@@ -48,26 +45,26 @@ func Form(action string, method string, submit templ.Component, progress string,
var templ_7745c5c3_Var3 string
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(method)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/styles/form/form.templ`, Line: 7, Col: 55}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/nebula/form/base.templ`, Line: 4, Col: 55}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"><sl-card class=\"card-form gap-4 max-w-lg\"><div slot=\"header\"><div class=\"w-full py-1\"><sl-progress-bar value=\"")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var4 string
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(progress)
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(id)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/styles/form/form.templ`, Line: 11, Col: 38}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/nebula/form/base.templ`, Line: 4, Col: 65}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"></sl-progress-bar></div></div>")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -75,21 +72,7 @@ func Form(action string, method string, submit templ.Component, progress string,
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div slot=\"footer\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if enableCancel {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<sl-button href=\"/\" outline><sl-icon slot=\"prefix\" name=\"arrow-left\" library=\"sonr\"></sl-icon> Cancel</sl-button>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
templ_7745c5c3_Err = submit.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><style>\n \t\t.card-form [slot='footer'] {\n \t\tdisplay: flex;\n \t\tjustify-content: space-between;\n \t\talign-items: center;\n \t\t}\n\t\t</style></sl-card></form>")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</form>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -97,7 +80,7 @@ func Form(action string, method string, submit templ.Component, progress string,
})
}
func NameInput() templ.Component {
func Header() templ.Component {
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
@@ -118,25 +101,15 @@ func NameInput() templ.Component {
templ_7745c5c3_Var5 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
templ_7745c5c3_Var6 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
if !templ_7745c5c3_IsBuffer {
defer func() {
templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
if templ_7745c5c3_Err == nil {
templ_7745c5c3_Err = templ_7745c5c3_BufErr
}
}()
}
ctx = templ.InitializeContext(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<sl-input name=\"first_name\" placeholder=\"Steve\" type=\"text\" label=\"First Name\" required autofocus></sl-input> <sl-input name=\"last_name\" placeholder=\"J\" maxlength=\"1\" type=\"text\" label=\"Last Initial\"></sl-input>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div slot=\"header\"><div class=\"w-full py-2\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
})
templ_7745c5c3_Err = layout.Rows().Render(templ.WithChildren(ctx, templ_7745c5c3_Var6), templ_7745c5c3_Buffer)
}
templ_7745c5c3_Err = templ_7745c5c3_Var5.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -144,7 +117,44 @@ func NameInput() templ.Component {
})
}
func HandleInput() templ.Component {
func Body() templ.Component {
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
return templ_7745c5c3_CtxErr
}
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
if !templ_7745c5c3_IsBuffer {
defer func() {
templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
if templ_7745c5c3_Err == nil {
templ_7745c5c3_Err = templ_7745c5c3_BufErr
}
}()
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var6 := templ.GetChildren(ctx)
if templ_7745c5c3_Var6 == nil {
templ_7745c5c3_Var6 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<sl-card class=\"card-form max-w-lg mx-auto\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templ_7745c5c3_Var6.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<style>\n\t\t.card-form {\n\t\t\t\tspace-y: 1rem;\n\t\t}\n\n \t.card-form [slot='header'] {\n \tdisplay: flex;\n \talign-items: center;\n \t justify-content: space-between;\n\t }\n\n\t .card-form [slot='footer'] {\n \t \tdisplay: flex;\n \tjustify-content: space-between;\n \talign-items: center;\n \t}\n\t\t</style></sl-card>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
return templ_7745c5c3_Err
})
}
func Footer() templ.Component {
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
@@ -165,7 +175,15 @@ func HandleInput() templ.Component {
templ_7745c5c3_Var7 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<sl-input name=\"handle\" placeholder=\"thoughtdiff\" type=\"text\" label=\"Handle\" minlength=\"4\" maxlength=\"12\" required><div slot=\"prefix\"><sl-icon name=\"at-sign\" library=\"sonr\"></sl-icon></div></sl-input>")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div slot=\"footer\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templ_7745c5c3_Var7.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -173,7 +191,7 @@ func HandleInput() templ.Component {
})
}
func CodeInput(id string) templ.Component {
func CancelButton() templ.Component {
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
@@ -194,20 +212,7 @@ func CodeInput(id string) templ.Component {
templ_7745c5c3_Var8 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<sl-input id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var9 string
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(id)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/styles/form/form.templ`, Line: 51, Col: 18}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" placeholder=\"●\" type=\"text\" maxlength=\"1\" pill class=\"w-min\"></sl-input>")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<sl-button href=\"/\" outline><sl-icon slot=\"prefix\" name=\"x-lg\"></sl-icon> Cancel</sl-button>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -215,8 +220,7 @@ func CodeInput(id string) templ.Component {
})
}
// Hidden input and button which calls a javascript function to generate a passkey
func PasskeyInput(id string) templ.Component {
func SubmitButton(text string) templ.Component {
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
@@ -232,98 +236,21 @@ func PasskeyInput(id string) templ.Component {
}()
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var10 := templ.GetChildren(ctx)
if templ_7745c5c3_Var10 == nil {
templ_7745c5c3_Var10 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
templ_7745c5c3_Err = CredentialsScripts().Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<sl-button type=\"submit\" pill style=\"width: 100%;\"><sl-icon slot=\"prefix\" name=\"passkey\" library=\"sonr\" style=\"font-size: 20px;\"></sl-icon> Create PassKey <sl-icon slot=\"suffix\" name=\"arrow-right\" library=\"sonr\" style=\"font-size: 20px;\"></sl-icon></sl-button>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
return templ_7745c5c3_Err
})
}
func TurnstileWidget(sitekey string) templ.Component {
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
return templ_7745c5c3_CtxErr
}
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
if !templ_7745c5c3_IsBuffer {
defer func() {
templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
if templ_7745c5c3_Err == nil {
templ_7745c5c3_Err = templ_7745c5c3_BufErr
}
}()
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var11 := templ.GetChildren(ctx)
if templ_7745c5c3_Var11 == nil {
templ_7745c5c3_Var11 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
if sitekey != "" {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<br><div class=\"cf-turnstile\" data-sitekey=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var12 string
templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(sitekey)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/styles/form/form.templ`, Line: 67, Col: 50}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
return templ_7745c5c3_Err
})
}
func Submit(text string) templ.Component {
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
return templ_7745c5c3_CtxErr
}
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
if !templ_7745c5c3_IsBuffer {
defer func() {
templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
if templ_7745c5c3_Err == nil {
templ_7745c5c3_Err = templ_7745c5c3_BufErr
}
}()
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var13 := templ.GetChildren(ctx)
if templ_7745c5c3_Var13 == nil {
templ_7745c5c3_Var13 = templ.NopComponent
templ_7745c5c3_Var9 := templ.GetChildren(ctx)
if templ_7745c5c3_Var9 == nil {
templ_7745c5c3_Var9 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<sl-button type=\"submit\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var14 string
templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(text)
var templ_7745c5c3_Var10 string
templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(text)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/styles/form/form.templ`, Line: 73, Col: 8}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/nebula/form/base.templ`, Line: 55, Col: 8}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14))
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
+70
View File
@@ -0,0 +1,70 @@
package input
type Coin struct {
Ticker string
Name string
IsDefault bool
}
var defaultCoins = []Coin{
{Ticker: "SNR", Name: "Sonr", IsDefault: true},
{Ticker: "BTC", Name: "Bitcoin", IsDefault: true},
{Ticker: "ETH", Name: "Ethereum", IsDefault: true},
{Ticker: "SOL", Name: "Solana", IsDefault: false},
{Ticker: "LTC", Name: "Litecoin", IsDefault: false},
{Ticker: "DOGE", Name: "Dogecoin", IsDefault: false},
{Ticker: "XRP", Name: "Ripple", IsDefault: false},
{Ticker: "OSMO", Name: "Osmosis", IsDefault: false},
{Ticker: "ATOM", Name: "Cosmos", IsDefault: false},
{Ticker: "STARZ", Name: "Stargaze", IsDefault: false},
{Ticker: "AKT", Name: "Akash", IsDefault: false},
{Ticker: "EVMOS", Name: "Evmos", IsDefault: false},
{Ticker: "FIL", Name: "Filecoin", IsDefault: false},
{Ticker: "AXL", Name: "Axelar", IsDefault: false},
}
templ CoinSelect() {
<sl-select
label="Accounts"
name="selected_assets"
value="SNR BTC ETH"
help-text="Select Blockchains to connect with your Vault"
multiple
class="custom-tag py-2"
>
for _, a := range defaultCoins {
@CoinOption(a)
}
</sl-select>
<script>
const select = document.querySelector('.custom-tag');
select.getTag = (option, index) => {
// Use the same icon used in the <sl-option>
const name = option.querySelector('sl-icon[slot="prefix"]').name;
// You can return a string, a Lit Template, or an HTMLElement here
return `
<sl-tag removable>
<sl-icon name="${name}" library="crypto" style="padding-inline-end: .5rem;"></sl-icon>
${option.getTextLabel()}
</sl-tag>
`;
};
</script>
}
templ CoinOption(a Coin) {
if a.IsDefault {
<sl-option value={ a.Ticker } selected disabled>
<sl-icon slot="prefix" name={ a.Ticker } library="crypto"></sl-icon>
{ a.Name }
</sl-option>
<sl-divider></sl-divider>
} else {
<sl-option value={ a.Ticker }>
<sl-icon slot="prefix" name={ a.Ticker } library="crypto"></sl-icon>
{ a.Name }
</sl-option>
<sl-divider></sl-divider>
}
}
+187
View File
@@ -0,0 +1,187 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.793
package input
//lint:file-ignore SA4006 This context is only used if a nested component is present.
import "github.com/a-h/templ"
import templruntime "github.com/a-h/templ/runtime"
type Coin struct {
Ticker string
Name string
IsDefault bool
}
var defaultCoins = []Coin{
{Ticker: "SNR", Name: "Sonr", IsDefault: true},
{Ticker: "BTC", Name: "Bitcoin", IsDefault: true},
{Ticker: "ETH", Name: "Ethereum", IsDefault: true},
{Ticker: "SOL", Name: "Solana", IsDefault: false},
{Ticker: "LTC", Name: "Litecoin", IsDefault: false},
{Ticker: "DOGE", Name: "Dogecoin", IsDefault: false},
{Ticker: "XRP", Name: "Ripple", IsDefault: false},
{Ticker: "OSMO", Name: "Osmosis", IsDefault: false},
{Ticker: "ATOM", Name: "Cosmos", IsDefault: false},
{Ticker: "STARZ", Name: "Stargaze", IsDefault: false},
{Ticker: "AKT", Name: "Akash", IsDefault: false},
{Ticker: "EVMOS", Name: "Evmos", IsDefault: false},
{Ticker: "FIL", Name: "Filecoin", IsDefault: false},
{Ticker: "AXL", Name: "Axelar", IsDefault: false},
}
func CoinSelect() templ.Component {
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
return templ_7745c5c3_CtxErr
}
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
if !templ_7745c5c3_IsBuffer {
defer func() {
templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
if templ_7745c5c3_Err == nil {
templ_7745c5c3_Err = templ_7745c5c3_BufErr
}
}()
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var1 := templ.GetChildren(ctx)
if templ_7745c5c3_Var1 == nil {
templ_7745c5c3_Var1 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<sl-select label=\"Accounts\" name=\"selected_assets\" value=\"SNR BTC ETH\" help-text=\"Select Blockchains to connect with your Vault\" multiple class=\"custom-tag py-2\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, a := range defaultCoins {
templ_7745c5c3_Err = CoinOption(a).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</sl-select><script>\n\t const select = document.querySelector('.custom-tag');\n select.getTag = (option, index) => {\n // Use the same icon used in the <sl-option>\n const name = option.querySelector('sl-icon[slot=\"prefix\"]').name;\n\n // You can return a string, a Lit Template, or an HTMLElement here\n return `\n <sl-tag removable>\n <sl-icon name=\"${name}\" library=\"crypto\" style=\"padding-inline-end: .5rem;\"></sl-icon>\n ${option.getTextLabel()}\n </sl-tag>\n `;\n };\n\t</script>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
return templ_7745c5c3_Err
})
}
func CoinOption(a Coin) templ.Component {
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
return templ_7745c5c3_CtxErr
}
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
if !templ_7745c5c3_IsBuffer {
defer func() {
templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
if templ_7745c5c3_Err == nil {
templ_7745c5c3_Err = templ_7745c5c3_BufErr
}
}()
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var2 := templ.GetChildren(ctx)
if templ_7745c5c3_Var2 == nil {
templ_7745c5c3_Var2 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
if a.IsDefault {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<sl-option value=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var3 string
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(a.Ticker)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/nebula/input/coin_select.templ`, Line: 58, Col: 29}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" selected disabled><sl-icon slot=\"prefix\" name=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var4 string
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(a.Ticker)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/nebula/input/coin_select.templ`, Line: 59, Col: 41}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" library=\"crypto\"></sl-icon> ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var5 string
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(a.Name)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/nebula/input/coin_select.templ`, Line: 60, Col: 11}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</sl-option> <sl-divider></sl-divider>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<sl-option value=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var6 string
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(a.Ticker)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/nebula/input/coin_select.templ`, Line: 64, Col: 29}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"><sl-icon slot=\"prefix\" name=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var7 string
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(a.Ticker)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/nebula/input/coin_select.templ`, Line: 65, Col: 41}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" library=\"crypto\"></sl-icon> ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var8 string
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(a.Name)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/nebula/input/coin_select.templ`, Line: 66, Col: 11}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</sl-option> <sl-divider></sl-divider>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
return templ_7745c5c3_Err
})
}
var _ = templruntime.GeneratedTemplate
+43
View File
@@ -0,0 +1,43 @@
package input
type HandleState string
const (
HandleStateInitial HandleState = "inital"
HandleStateValid HandleState = "valid"
HandleStateInvalid HandleState = "invalid"
)
func (s HandleState) string() string {
return string(s)
}
templ Handle() {
<sl-input name="handle" placeholder="digitalgold" type="text" label="Handle" minlength="4" maxlength="12" required>
<div slot="prefix">
<sl-icon name="at-sign" library="sonr"></sl-icon>
</div>
</sl-input>
<br/>
}
templ HandleError() {
<sl-input name="handle" placeholder="digitalgold" type="text" label="Handle" minlength="4" maxlength="12" required class="border-red-500">
<div slot="prefix">
<sl-icon name="at-sign" library="sonr"></sl-icon>
</div>
<div slot="suffix" style="color: #B54549;">
<sl-icon name="at-sign" library="sonr"></sl-icon>
</div>
</sl-input>
<br/>
}
templ HandleValid() {
<sl-input name="handle" placeholder="digitalgold" type="text" label="Handle" minlength="4" maxlength="12" required class="border-green-500">
<div slot="prefix" style="color: #46A758;">
<sl-icon name="at-sign" library="sonr"></sl-icon>
</div>
</sl-input>
<br/>
}
+110
View File
@@ -0,0 +1,110 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.793
package input
//lint:file-ignore SA4006 This context is only used if a nested component is present.
import "github.com/a-h/templ"
import templruntime "github.com/a-h/templ/runtime"
type HandleState string
const (
HandleStateInitial HandleState = "inital"
HandleStateValid HandleState = "valid"
HandleStateInvalid HandleState = "invalid"
)
func (s HandleState) string() string {
return string(s)
}
func Handle() templ.Component {
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
return templ_7745c5c3_CtxErr
}
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
if !templ_7745c5c3_IsBuffer {
defer func() {
templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
if templ_7745c5c3_Err == nil {
templ_7745c5c3_Err = templ_7745c5c3_BufErr
}
}()
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var1 := templ.GetChildren(ctx)
if templ_7745c5c3_Var1 == nil {
templ_7745c5c3_Var1 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<sl-input name=\"handle\" placeholder=\"digitalgold\" type=\"text\" label=\"Handle\" minlength=\"4\" maxlength=\"12\" required><div slot=\"prefix\"><sl-icon name=\"at-sign\" library=\"sonr\"></sl-icon></div></sl-input><br>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
return templ_7745c5c3_Err
})
}
func HandleError() templ.Component {
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
return templ_7745c5c3_CtxErr
}
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
if !templ_7745c5c3_IsBuffer {
defer func() {
templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
if templ_7745c5c3_Err == nil {
templ_7745c5c3_Err = templ_7745c5c3_BufErr
}
}()
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var2 := templ.GetChildren(ctx)
if templ_7745c5c3_Var2 == nil {
templ_7745c5c3_Var2 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<sl-input name=\"handle\" placeholder=\"digitalgold\" type=\"text\" label=\"Handle\" minlength=\"4\" maxlength=\"12\" required class=\"border-red-500\"><div slot=\"prefix\"><sl-icon name=\"at-sign\" library=\"sonr\"></sl-icon></div><div slot=\"suffix\" style=\"color: #B54549;\"><sl-icon name=\"at-sign\" library=\"sonr\"></sl-icon></div></sl-input><br>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
return templ_7745c5c3_Err
})
}
func HandleValid() templ.Component {
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
return templ_7745c5c3_CtxErr
}
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
if !templ_7745c5c3_IsBuffer {
defer func() {
templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
if templ_7745c5c3_Err == nil {
templ_7745c5c3_Err = templ_7745c5c3_BufErr
}
}()
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var3 := templ.GetChildren(ctx)
if templ_7745c5c3_Var3 == nil {
templ_7745c5c3_Var3 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<sl-input name=\"handle\" placeholder=\"digitalgold\" type=\"text\" label=\"Handle\" minlength=\"4\" maxlength=\"12\" required class=\"border-green-500\"><div slot=\"prefix\" style=\"color: #46A758;\"><sl-icon name=\"at-sign\" library=\"sonr\"></sl-icon></div></sl-input><br>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
return templ_7745c5c3_Err
})
}
var _ = templruntime.GeneratedTemplate
+37
View File
@@ -0,0 +1,37 @@
package input
type NameState string
const (
NameStateInitial NameState = "inital"
NameStateValid NameState = "valid"
NameStateInvalid NameState = "invalid"
)
func (s NameState) string() string {
return string(s)
}
templ Name() {
<div hx-target="this" hx-swap="outerHTML" class="grid grid-cols-1 lg:grid-cols-2 gap-4">
<sl-input name="first_name" placeholder="Satoshi" type="text" label="First Name" required autofocus></sl-input>
<sl-input name="last_name" placeholder="N" maxlength="1" type="text" label="Last Initial"></sl-input>
</div>
<br/>
}
templ NameError() {
<div class="grid grid-cols-1 lg:grid-cols-2 gap-4">
<sl-input name="first_name" placeholder="Satoshi" type="text" label="First Name" required autofocus class="border-red-500"></sl-input>
<sl-input name="last_name" placeholder="N" maxlength="1" type="text" label="Last Initial" class="border-red-500"></sl-input>
</div>
<br/>
}
templ NameValid() {
<div class="grid grid-cols-1 lg:grid-cols-2 gap-4">
<sl-input name="first_name" placeholder="Satoshi" type="text" label="First Name" required autofocus class="border-green-500"></sl-input>
<sl-input name="last_name" placeholder="N" maxlength="1" type="text" label="Last Initial" class="border-green-500"></sl-input>
</div>
<br/>
}
+110
View File
@@ -0,0 +1,110 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.793
package input
//lint:file-ignore SA4006 This context is only used if a nested component is present.
import "github.com/a-h/templ"
import templruntime "github.com/a-h/templ/runtime"
type NameState string
const (
NameStateInitial NameState = "inital"
NameStateValid NameState = "valid"
NameStateInvalid NameState = "invalid"
)
func (s NameState) string() string {
return string(s)
}
func Name() templ.Component {
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
return templ_7745c5c3_CtxErr
}
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
if !templ_7745c5c3_IsBuffer {
defer func() {
templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
if templ_7745c5c3_Err == nil {
templ_7745c5c3_Err = templ_7745c5c3_BufErr
}
}()
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var1 := templ.GetChildren(ctx)
if templ_7745c5c3_Var1 == nil {
templ_7745c5c3_Var1 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div hx-target=\"this\" hx-swap=\"outerHTML\" class=\"grid grid-cols-1 lg:grid-cols-2 gap-4\"><sl-input name=\"first_name\" placeholder=\"Satoshi\" type=\"text\" label=\"First Name\" required autofocus></sl-input> <sl-input name=\"last_name\" placeholder=\"N\" maxlength=\"1\" type=\"text\" label=\"Last Initial\"></sl-input></div><br>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
return templ_7745c5c3_Err
})
}
func NameError() templ.Component {
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
return templ_7745c5c3_CtxErr
}
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
if !templ_7745c5c3_IsBuffer {
defer func() {
templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
if templ_7745c5c3_Err == nil {
templ_7745c5c3_Err = templ_7745c5c3_BufErr
}
}()
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var2 := templ.GetChildren(ctx)
if templ_7745c5c3_Var2 == nil {
templ_7745c5c3_Var2 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"grid grid-cols-1 lg:grid-cols-2 gap-4\"><sl-input name=\"first_name\" placeholder=\"Satoshi\" type=\"text\" label=\"First Name\" required autofocus class=\"border-red-500\"></sl-input> <sl-input name=\"last_name\" placeholder=\"N\" maxlength=\"1\" type=\"text\" label=\"Last Initial\" class=\"border-red-500\"></sl-input></div><br>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
return templ_7745c5c3_Err
})
}
func NameValid() templ.Component {
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
return templ_7745c5c3_CtxErr
}
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
if !templ_7745c5c3_IsBuffer {
defer func() {
templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
if templ_7745c5c3_Err == nil {
templ_7745c5c3_Err = templ_7745c5c3_BufErr
}
}()
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var3 := templ.GetChildren(ctx)
if templ_7745c5c3_Var3 == nil {
templ_7745c5c3_Var3 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"grid grid-cols-1 lg:grid-cols-2 gap-4\"><sl-input name=\"first_name\" placeholder=\"Satoshi\" type=\"text\" label=\"First Name\" required autofocus class=\"border-green-500\"></sl-input> <sl-input name=\"last_name\" placeholder=\"N\" maxlength=\"1\" type=\"text\" label=\"Last Initial\" class=\"border-green-500\"></sl-input></div><br>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
return templ_7745c5c3_Err
})
}
var _ = templruntime.GeneratedTemplate
+94
View File
@@ -0,0 +1,94 @@
package input
templ Passkey(addr string, userHandle string, challenge string) {
<sl-button style="width: 100%;" onclick={ navigatorCredentialsCreate(addr, userHandle, challenge) }>
<sl-icon slot="prefix" name="passkey" library="sonr" style="font-size: 24px;" class="text-neutral-500"></sl-icon>
Register Passkey
</sl-button>
}
script navigatorCredentialsCreate(userId string, userHandle string, challenge string) {
const publicKey = {
challenge: Uint8Array.from(challenge, (c) => c.charCodeAt(0)),
rp: {
name: "Sonr.ID",
},
user: {
// Assuming that userId is ASCII-only
id: Uint8Array.from(userId, (c) => c.charCodeAt(0)),
name: userId,
displayName: userHandle,
},
pubKeyCredParams: [
{
type: "public-key",
alg: -7, // "ES256"
},
{
type: "public-key",
alg: -257, // "RS256"
},
],
authenticatorSelection: {
userVerification: "required",
residentKey: "required",
authenticatorAttachment: "platform",
},
timeout: 60000, // 1 minute
extensions: {
payment: {
isPayment: true,
},
},
};
// Helper function to convert ArrayBuffer to Base64URL string
function arrayBufferToBase64URL(buffer) {
const bytes = new Uint8Array(buffer);
let str = '';
bytes.forEach(byte => { str += String.fromCharCode(byte) });
return btoa(str)
.replace(/\+/g, '-')
.replace(/\//g, '_')
.replace(/=/g, '');
}
navigator.credentials
.create({ publicKey })
.then((newCredentialInfo) => {
if (!(newCredentialInfo instanceof PublicKeyCredential)) {
throw new Error('Received credential is not a PublicKeyCredential');
}
const response = newCredentialInfo.response;
if (!(response instanceof AuthenticatorAttestationResponse)) {
throw new Error('Response is not an AuthenticatorAttestationResponse');
}
// Convert the credential data to a cross-platform compatible format
const credentialJSON = {
id: newCredentialInfo.id,
rawId: arrayBufferToBase64URL(newCredentialInfo.rawId),
type: newCredentialInfo.type,
authenticatorAttachment: newCredentialInfo.authenticatorAttachment || null,
transports: Array.isArray(response.getTransports) ? response.getTransports() : [],
clientExtensionResults: newCredentialInfo.getClientExtensionResults(),
response: {
attestationObject: arrayBufferToBase64URL(response.attestationObject),
clientDataJSON: arrayBufferToBase64URL(response.clientDataJSON)
}
};
// Set the form value with the stringified credential data
const credential = document.getElementById('credential-data');
credential.value = JSON.stringify(credentialJSON);
// Submit the form
const form = document.getElementById('passkey-form');
form.submit();
})
.catch((err) => {
console.error('Passkey creation failed:', err);
alert(`Failed to create passkey: ${err.message || 'Unknown error'}`);
});
}
@@ -0,0 +1,145 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.793
package input
//lint:file-ignore SA4006 This context is only used if a nested component is present.
import "github.com/a-h/templ"
import templruntime "github.com/a-h/templ/runtime"
func Passkey(addr string, userHandle string, challenge string) templ.Component {
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
return templ_7745c5c3_CtxErr
}
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
if !templ_7745c5c3_IsBuffer {
defer func() {
templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
if templ_7745c5c3_Err == nil {
templ_7745c5c3_Err = templ_7745c5c3_BufErr
}
}()
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var1 := templ.GetChildren(ctx)
if templ_7745c5c3_Var1 == nil {
templ_7745c5c3_Var1 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, navigatorCredentialsCreate(addr, userHandle, challenge))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<sl-button style=\"width: 100%;\" onclick=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var2 templ.ComponentScript = navigatorCredentialsCreate(addr, userHandle, challenge)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var2.Call)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"><sl-icon slot=\"prefix\" name=\"passkey\" library=\"sonr\" style=\"font-size: 24px;\" class=\"text-neutral-500\"></sl-icon> Register Passkey</sl-button>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
return templ_7745c5c3_Err
})
}
func navigatorCredentialsCreate(userId string, userHandle string, challenge string) templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_navigatorCredentialsCreate_7340`,
Function: `function __templ_navigatorCredentialsCreate_7340(userId, userHandle, challenge){const publicKey = {
challenge: Uint8Array.from(challenge, (c) => c.charCodeAt(0)),
rp: {
name: "Sonr.ID",
},
user: {
// Assuming that userId is ASCII-only
id: Uint8Array.from(userId, (c) => c.charCodeAt(0)),
name: userId,
displayName: userHandle,
},
pubKeyCredParams: [
{
type: "public-key",
alg: -7, // "ES256"
},
{
type: "public-key",
alg: -257, // "RS256"
},
],
authenticatorSelection: {
userVerification: "required",
residentKey: "required",
authenticatorAttachment: "platform",
},
timeout: 60000, // 1 minute
extensions: {
payment: {
isPayment: true,
},
},
};
// Helper function to convert ArrayBuffer to Base64URL string
function arrayBufferToBase64URL(buffer) {
const bytes = new Uint8Array(buffer);
let str = '';
bytes.forEach(byte => { str += String.fromCharCode(byte) });
return btoa(str)
.replace(/\+/g, '-')
.replace(/\//g, '_')
.replace(/=/g, '');
}
navigator.credentials
.create({ publicKey })
.then((newCredentialInfo) => {
if (!(newCredentialInfo instanceof PublicKeyCredential)) {
throw new Error('Received credential is not a PublicKeyCredential');
}
const response = newCredentialInfo.response;
if (!(response instanceof AuthenticatorAttestationResponse)) {
throw new Error('Response is not an AuthenticatorAttestationResponse');
}
// Convert the credential data to a cross-platform compatible format
const credentialJSON = {
id: newCredentialInfo.id,
rawId: arrayBufferToBase64URL(newCredentialInfo.rawId),
type: newCredentialInfo.type,
authenticatorAttachment: newCredentialInfo.authenticatorAttachment || null,
transports: Array.isArray(response.getTransports) ? response.getTransports() : [],
clientExtensionResults: newCredentialInfo.getClientExtensionResults(),
response: {
attestationObject: arrayBufferToBase64URL(response.attestationObject),
clientDataJSON: arrayBufferToBase64URL(response.clientDataJSON)
}
};
// Set the form value with the stringified credential data
const credential = document.getElementById('credential-data');
credential.value = JSON.stringify(credentialJSON);
// Submit the form
const form = document.getElementById('passkey-form');
form.submit();
})
.catch((err) => {
console.error('Passkey creation failed:', err);
alert(` + "`" + `Failed to create passkey: ${err.message || 'Unknown error'}` + "`" + `);
});
}`,
Call: templ.SafeScript(`__templ_navigatorCredentialsCreate_7340`, userId, userHandle, challenge),
CallInline: templ.SafeScriptInline(`__templ_navigatorCredentialsCreate_7340`, userId, userHandle, challenge),
}
}
var _ = templruntime.GeneratedTemplate
@@ -0,0 +1,11 @@
package input
import "fmt"
templ HumanSlider(firstNumber int, lastNumber int) {
<sl-range name="is_human" label={ formatHumanSliderLabel(firstNumber, lastNumber) } help-text="Prove you are a human." min="0" max="9" step="1"></sl-range>
}
func formatHumanSliderLabel(firstNumber int, lastNumber int) string {
return fmt.Sprintf("What is %d + %d?", firstNumber, lastNumber)
}
@@ -0,0 +1,59 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.793
package input
//lint:file-ignore SA4006 This context is only used if a nested component is present.
import "github.com/a-h/templ"
import templruntime "github.com/a-h/templ/runtime"
import "fmt"
func HumanSlider(firstNumber int, lastNumber int) templ.Component {
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
return templ_7745c5c3_CtxErr
}
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
if !templ_7745c5c3_IsBuffer {
defer func() {
templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
if templ_7745c5c3_Err == nil {
templ_7745c5c3_Err = templ_7745c5c3_BufErr
}
}()
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var1 := templ.GetChildren(ctx)
if templ_7745c5c3_Var1 == nil {
templ_7745c5c3_Var1 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<sl-range name=\"is_human\" label=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var2 string
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(formatHumanSliderLabel(firstNumber, lastNumber))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/nebula/input/input_slider_isHuman.templ`, Line: 6, Col: 82}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" help-text=\"Prove you are a human.\" min=\"0\" max=\"9\" step=\"1\"></sl-range>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
return templ_7745c5c3_Err
})
}
func formatHumanSliderLabel(firstNumber int, lastNumber int) string {
return fmt.Sprintf("What is %d + %d?", firstNumber, lastNumber)
}
var _ = templruntime.GeneratedTemplate
+24
View File
@@ -0,0 +1,24 @@
package layout
// Columns is a component that renders a responsive flex container that stacks on mobile
templ Columns() {
<div class="flex flex-col h-full w-full gap-4 md:gap-6 md:flex-row md:flex-wrap">
{ children... }
</div>
}
// Rows is a component that renders a responsive flex container that wraps on mobile
templ Rows() {
<div class="flex flex-col w-full gap-3 sm:flex-row sm:flex-wrap sm:gap-4">
{ children... }
</div>
}
templ Separator(text string) {
<div class="relative py-6">
<div class="absolute inset-0 flex items-center"><span class="w-full border-t"></span></div>
<div class="relative flex justify-center text-xs uppercase">
<span class="px-2 text-neutral-500">{ text }</span>
</div>
</div>
}
@@ -8,7 +8,7 @@ package layout
import "github.com/a-h/templ"
import templruntime "github.com/a-h/templ/runtime"
// Columns is a component that renders a flex container with a gap of 3 and a max width of 100%
// Columns is a component that renders a responsive flex container that stacks on mobile
func Columns() templ.Component {
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
@@ -30,7 +30,7 @@ func Columns() templ.Component {
templ_7745c5c3_Var1 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"flex flex-col h-full w-full gap-3 md:gap-6 md:flex-row\">")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"flex flex-col h-full w-full gap-4 md:gap-6 md:flex-row md:flex-wrap\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -46,7 +46,8 @@ func Columns() templ.Component {
})
}
func Container() templ.Component {
// Rows is a component that renders a responsive flex container that wraps on mobile
func Rows() templ.Component {
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
@@ -67,7 +68,7 @@ func Container() templ.Component {
templ_7745c5c3_Var2 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"container\" class=\"flex fixed inset-0 z-[99] w-screen h-screen\"><div class=\"relative flex flex-wrap items-center w-full h-full px-8\"><div class=\"relative w-full max-w-sm mx-auto lg:mb-0\"><div class=\"flex flex-col items-center justify-center h-full\">")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"flex flex-col w-full gap-3 sm:flex-row sm:flex-wrap sm:gap-4\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -75,44 +76,6 @@ func Container() templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></div></div></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
return templ_7745c5c3_Err
})
}
// Rows is a component that renders a flex container with a gap of 2 and a max width of 100%
func Rows() templ.Component {
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
return templ_7745c5c3_CtxErr
}
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
if !templ_7745c5c3_IsBuffer {
defer func() {
templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
if templ_7745c5c3_Err == nil {
templ_7745c5c3_Err = templ_7745c5c3_BufErr
}
}()
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var3 := templ.GetChildren(ctx)
if templ_7745c5c3_Var3 == nil {
templ_7745c5c3_Var3 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"flex flex-row w-full gap-2 md:gap-4 max-w-fit\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templ_7745c5c3_Var3.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
@@ -121,36 +84,6 @@ func Rows() templ.Component {
})
}
// Spacer is a component that renders a <br/> tag
func Spacer() templ.Component {
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
return templ_7745c5c3_CtxErr
}
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
if !templ_7745c5c3_IsBuffer {
defer func() {
templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
if templ_7745c5c3_Err == nil {
templ_7745c5c3_Err = templ_7745c5c3_BufErr
}
}()
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var4 := templ.GetChildren(ctx)
if templ_7745c5c3_Var4 == nil {
templ_7745c5c3_Var4 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<br>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
return templ_7745c5c3_Err
})
}
func Separator(text string) templ.Component {
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
@@ -167,21 +100,21 @@ func Separator(text string) templ.Component {
}()
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var5 := templ.GetChildren(ctx)
if templ_7745c5c3_Var5 == nil {
templ_7745c5c3_Var5 = templ.NopComponent
templ_7745c5c3_Var3 := templ.GetChildren(ctx)
if templ_7745c5c3_Var3 == nil {
templ_7745c5c3_Var3 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"relative py-6\"><div class=\"absolute inset-0 flex items-center\"><span class=\"w-full border-t\"></span></div><div class=\"relative flex justify-center text-xs uppercase\"><span class=\"px-2 text-neutral-500\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var6 string
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(text)
var templ_7745c5c3_Var4 string
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(text)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/styles/layout/container.templ`, Line: 38, Col: 45}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/nebula/layout/container.templ`, Line: 21, Col: 45}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -24,12 +24,12 @@ var (
)
// Layout is a component that renders the general layout of the application
templ Root(title string) {
templ View(title string) {
<!DOCTYPE html>
<html lang="en">
@Head(title, "0.0.11")
<body class="flex items-center justify-center h-full lg:p-24 md:16 p-4 no-scrollbar">
<main class="flex-row items-center justify-center mx-auto w-fit max-w-screen-sm gap-y-3">
<main class="flex-row items-center justify-center mx-auto w-fit max-w-screen-lg gap-y-3">
{ children... }
</main>
</body>
@@ -52,11 +52,52 @@ templ Head(title string, nebulaVersion string) {
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/>
<link rel="icon" type="image/png" href="https://cdn.sonr.id/favicon.png"/>
<style>
@keyframes fade-in {
from { opacity: 0; }
}
@keyframes fade-out {
to { opacity: 0; }
}
@keyframes slide-from-right {
from { transform: translateX(90px); }
}
@keyframes slide-to-left {
to { transform: translateX(-90px); }
}
.slide-it {
view-transition-name: slide-it;
}
::view-transition-old(slide-it) {
animation: 180ms cubic-bezier(0.4, 0, 1, 1) both fade-out,
600ms cubic-bezier(0.4, 0, 0.2, 1) both slide-to-left;
}
::view-transition-new(slide-it) {
animation: 420ms cubic-bezier(0, 0, 0.2, 1) 90ms both fade-in,
600ms cubic-bezier(0.4, 0, 0.2, 1) both slide-from-right;
}
</style>
{ children... }
</head>
}
templ Body(align Alignment, screenWidth ScreenWidth) {
<style>
.sl-toast-stack {
top: auto;
bottom: 0;
left: auto;
right: 0;
}
.no-scrollbar::-webkit-scrollbar {
display: none;
}
</style>
<body class="flex items-center justify-center h-full lg:p-24 md:16 p-4 no-scrollbar">
<main class="flex-row items-center justify-center mx-auto w-fit max-w-screen-sm gap-y-3">
{ children... }
@@ -32,7 +32,7 @@ var (
)
// Layout is a component that renders the general layout of the application
func Root(title string) templ.Component {
func View(title string) templ.Component {
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
@@ -61,7 +61,7 @@ func Root(title string) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<body class=\"flex items-center justify-center h-full lg:p-24 md:16 p-4 no-scrollbar\"><main class=\"flex-row items-center justify-center mx-auto w-fit max-w-screen-sm gap-y-3\">")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<body class=\"flex items-center justify-center h-full lg:p-24 md:16 p-4 no-scrollbar\"><main class=\"flex-row items-center justify-center mx-auto w-fit max-w-screen-lg gap-y-3\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -133,13 +133,13 @@ func Head(title string, nebulaVersion string) templ.Component {
var templ_7745c5c3_Var3 string
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(title)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/styles/layout/layout.templ`, Line: 50, Col: 16}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/nebula/layout/layout.templ`, Line: 50, Col: 16}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</title><!-- Sets the status bar style to transparent --><meta name=\"apple-mobile-web-app-capable\" content=\"yes\"><meta name=\"apple-mobile-web-app-status-bar-style\" content=\"black-translucent\"><link rel=\"icon\" type=\"image/png\" href=\"https://cdn.sonr.id/favicon.png\">")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</title><!-- Sets the status bar style to transparent --><meta name=\"apple-mobile-web-app-capable\" content=\"yes\"><meta name=\"apple-mobile-web-app-status-bar-style\" content=\"black-translucent\"><link rel=\"icon\" type=\"image/png\" href=\"https://cdn.sonr.id/favicon.png\"><style>\n \t\t@keyframes fade-in {\n \t\tfrom { opacity: 0; }\n \t\t}\n\n \t\t@keyframes fade-out {\n \t\tto { opacity: 0; }\n \t\t}\n\n \t\t@keyframes slide-from-right {\n \t\tfrom { transform: translateX(90px); }\n \t\t}\n\n \t\t@keyframes slide-to-left {\n \t\tto { transform: translateX(-90px); }\n \t\t}\n\n \t\t.slide-it {\n \t\tview-transition-name: slide-it;\n \t\t}\n\n \t\t::view-transition-old(slide-it) {\n \t\tanimation: 180ms cubic-bezier(0.4, 0, 1, 1) both fade-out,\n \t\t600ms cubic-bezier(0.4, 0, 0.2, 1) both slide-to-left;\n \t\t}\n \t\t::view-transition-new(slide-it) {\n \t\tanimation: 420ms cubic-bezier(0, 0, 0.2, 1) 90ms both fade-in,\n \t\t600ms cubic-bezier(0.4, 0, 0.2, 1) both slide-from-right;\n \t\t}\n\t\t</style>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -176,7 +176,7 @@ func Body(align Alignment, screenWidth ScreenWidth) templ.Component {
templ_7745c5c3_Var4 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<body class=\"flex items-center justify-center h-full lg:p-24 md:16 p-4 no-scrollbar\"><main class=\"flex-row items-center justify-center mx-auto w-fit max-w-screen-sm gap-y-3\">")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<style>\n\t\t.sl-toast-stack {\n\t\t\ttop: auto;\n\t\t\tbottom: 0;\n \t\tleft: auto;\n \t\tright: 0;\n\t\t}\n\t\t.no-scrollbar::-webkit-scrollbar {\n\t\t\tdisplay: none;\n\t\t}\n\t</style><body class=\"flex items-center justify-center h-full lg:p-24 md:16 p-4 no-scrollbar\"><main class=\"flex-row items-center justify-center mx-auto w-fit max-w-screen-sm gap-y-3\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -18,7 +18,7 @@ var (
// Tailwind css dependencies
templ Tailwind() {
@tailwindHandle.Once() {
<script src="https://cdn.tailwindcss.com?plugins=typography,aspect-ratio,line-clamp,container-queries"></script>
<script src="https://cdn.tailwindcss.com?plugins=typography,aspect-ratio,container-queries"></script>
<script src="https://kit.fontawesome.com/9909219bb5.js" crossorigin="anonymous"></script>
}
}
@@ -57,7 +57,7 @@ func Tailwind() templ.Component {
}()
}
ctx = templ.InitializeContext(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<script src=\"https://cdn.tailwindcss.com?plugins=typography,aspect-ratio,line-clamp,container-queries\"></script> <script src=\"https://kit.fontawesome.com/9909219bb5.js\" crossorigin=\"anonymous\"></script>")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<script src=\"https://cdn.tailwindcss.com?plugins=typography,aspect-ratio,container-queries\"></script> <script src=\"https://kit.fontawesome.com/9909219bb5.js\" crossorigin=\"anonymous\"></script>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -160,7 +160,7 @@ func Alpine() templ.Component {
var templ_7745c5c3_Var7 string
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(jsDelivrURL("alpinejs", "3.14.6", "dist/cdn.min.js"))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/styles/layout/imports.templ`, Line: 36, Col: 68}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/nebula/layout/scripts.templ`, Line: 36, Col: 68}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
if templ_7745c5c3_Err != nil {
@@ -173,7 +173,7 @@ func Alpine() templ.Component {
var templ_7745c5c3_Var8 string
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(jsDelivrURL("@alpinejs/focus", "3.14.6", "dist/cdn.min.js"))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/styles/layout/imports.templ`, Line: 37, Col: 75}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/nebula/layout/scripts.templ`, Line: 37, Col: 75}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8))
if templ_7745c5c3_Err != nil {
@@ -234,7 +234,7 @@ func Dexie() templ.Component {
var templ_7745c5c3_Var11 string
templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(jsDelivrURL("dexie", "4.0.10", "dist/dexie.min.js"))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/styles/layout/imports.templ`, Line: 44, Col: 67}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/nebula/layout/scripts.templ`, Line: 44, Col: 67}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11))
if templ_7745c5c3_Err != nil {
@@ -247,7 +247,7 @@ func Dexie() templ.Component {
var templ_7745c5c3_Var12 string
templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(jsDelivrURL("dexie-export-import", "4.1.4", "dist/dexie-export-import.min.js"))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/styles/layout/imports.templ`, Line: 45, Col: 94}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/nebula/layout/scripts.templ`, Line: 45, Col: 94}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12))
if templ_7745c5c3_Err != nil {
@@ -308,7 +308,7 @@ func Htmx() templ.Component {
var templ_7745c5c3_Var15 string
templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(jsDelivrURL("htmx.org", "1.9.12", "dist/htmx.min.js"))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/styles/layout/imports.templ`, Line: 52, Col: 69}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/nebula/layout/scripts.templ`, Line: 52, Col: 69}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15))
if templ_7745c5c3_Err != nil {
@@ -321,7 +321,7 @@ func Htmx() templ.Component {
var templ_7745c5c3_Var16 string
templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(jsDelivrURL("htmx-ext-include-vals", "2.0.0", "include-vals.min.js"))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/styles/layout/imports.templ`, Line: 53, Col: 84}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/nebula/layout/scripts.templ`, Line: 53, Col: 84}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16))
if templ_7745c5c3_Err != nil {
@@ -334,7 +334,7 @@ func Htmx() templ.Component {
var templ_7745c5c3_Var17 string
templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(jsDelivrURL("htmx-ext-path-params", "2.0.0", "path-params.min.js"))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/styles/layout/imports.templ`, Line: 54, Col: 82}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/nebula/layout/scripts.templ`, Line: 54, Col: 82}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17))
if templ_7745c5c3_Err != nil {
@@ -347,7 +347,7 @@ func Htmx() templ.Component {
var templ_7745c5c3_Var18 string
templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(jsDelivrURL("htmx-ext-alpine-morph", "2.0.0", "alpine-morph.min.js"))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/styles/layout/imports.templ`, Line: 55, Col: 84}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/nebula/layout/scripts.templ`, Line: 55, Col: 84}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var18))
if templ_7745c5c3_Err != nil {
@@ -396,7 +396,7 @@ func Nebula(version string) templ.Component {
var templ_7745c5c3_Var20 string
templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(jsDelivrURL("@onsonr/nebula", version, "cdn/themes/light.css"))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/styles/layout/imports.templ`, Line: 64, Col: 71}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/nebula/layout/scripts.templ`, Line: 64, Col: 71}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var20))
if templ_7745c5c3_Err != nil {
@@ -409,7 +409,7 @@ func Nebula(version string) templ.Component {
var templ_7745c5c3_Var21 string
templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.JoinStringErrs(jsDelivrURL("@onsonr/nebula", version, "cdn/themes/dark.css"))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/styles/layout/imports.templ`, Line: 69, Col: 70}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/nebula/layout/scripts.templ`, Line: 69, Col: 70}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var21))
if templ_7745c5c3_Err != nil {
@@ -438,7 +438,7 @@ func Nebula(version string) templ.Component {
var templ_7745c5c3_Var23 string
templ_7745c5c3_Var23, templ_7745c5c3_Err = templ.JoinStringErrs(jsDelivrURL("@onsonr/nebula", version, "cdn/shoelace-autoloader.js"))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/styles/layout/imports.templ`, Line: 73, Col: 98}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/nebula/layout/scripts.templ`, Line: 73, Col: 98}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var23))
if templ_7745c5c3_Err != nil {
+10
View File
@@ -0,0 +1,10 @@
package nav
templ Footer() {
<footer class="flex items-center justify-center w-full h-16 bg-gradient-to-r from-cyan-700 to-cyan-300 px-4 py-2 rounded-xl">
<div class="flex items-center gap-3">
<sl-icon library="sonr" name="sonr-fill" class="w-8 h-8"></sl-icon>
<h1 class="text-white text-2xl font-bold">Sonr.ID</h1>
</div>
</footer>
}
@@ -1,14 +1,14 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.793
package internal
package nav
//lint:file-ignore SA4006 This context is only used if a nested component is present.
import "github.com/a-h/templ"
import templruntime "github.com/a-h/templ/runtime"
func IntroView() templ.Component {
func Footer() templ.Component {
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
@@ -29,7 +29,7 @@ func IntroView() templ.Component {
templ_7745c5c3_Var1 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"relative w-full max-w-sm mx-auto lg:mb-0\"><div class=\"relative text-center\"><div class=\"flex flex-col mb-6 space-y-2\"><span><wa-qr-code size=\"140\" value=\"https://shoelace.style/\"></wa-qr-code></span><h1 class=\"text-2xl lg:text-3xl font-bold pb-3\"><span>Shoelace</span></h1><p class=\"text-lg text-zinc-500\">A lightweight library for building accessible, high-performance UI components with no dependencies.</p></div><div class=\"max-w-xs mx-auto sm:max-w-none sm:inline-flex sm:justify-center space-y-4 sm:space-y-0 sm:space-x-4\"><button class=\"inline-flex items-center justify-center w-full h-10 px-4 py-2 text-sm font font-medium text-white transition-colors duration-200 rounded-md bg-neutral-950 hover:bg-neutral-900 focus:ring-2 focus:ring-offset-2 focus:ring-neutral-900\">Get started</button></div></div></div>")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<footer class=\"flex items-center justify-center w-full h-16 bg-gradient-to-r from-cyan-700 to-cyan-300 px-4 py-2 rounded-xl\"><div class=\"flex items-center gap-3\"><sl-icon library=\"sonr\" name=\"sonr-fill\" class=\"w-8 h-8\"></sl-icon><h1 class=\"text-white text-2xl font-bold\">Sonr.ID</h1></div></footer>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
+35
View File
@@ -0,0 +1,35 @@
package nav
templ Header() {
<header class="absolute top-0 left-0 right-0 z-50 flex items-center justify-between p-4 lg:p-6 w-full h-16">
<nav class="mx-auto flex max-w-7xl items-center justify-between p-6 lg:px-8" aria-label="Global">
<div class="flex flex-1">
<div class="flex flex-1">
<a href="/" class="text-sm/6 font-semibold text-gray-900">Return Home <span aria-hidden="true">&rarr;</span></a>
</div>
<div class="flex lg:hidden">
<button type="button" class="-m-2.5 inline-flex items-center justify-center rounded-md p-2.5 text-gray-700">
<span class="sr-only">Open main menu</span>
<svg class="size-6" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true" data-slot="icon">
<path stroke-linecap="round" stroke-linejoin="round" d="M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"></path>
</svg>
</button>
</div>
</div>
<a href="/" class="-m-1.5 p-1.5">
<span class="sr-only">Sonr.ID</span>
<sl-icon library="sonr" name="sonr" style="font-size: 32px; color: #17c2ff;"></sl-icon>
</a>
<div class="flex flex-1 justify-end gap-3"></div>
</nav>
</header>
}
templ NavFooter() {
<footer class="flex items-center justify-center w-full h-16 bg-gradient-to-r from-cyan-700 to-cyan-300 px-4 py-2 rounded-xl">
<div class="flex items-center gap-3">
<sl-icon library="sonr" name="sonr-fill" class="w-8 h-8"></sl-icon>
<h1 class="text-white text-2xl font-bold">Sonr.ID</h1>
</div>
</footer>
}
+69
View File
@@ -0,0 +1,69 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.793
package nav
//lint:file-ignore SA4006 This context is only used if a nested component is present.
import "github.com/a-h/templ"
import templruntime "github.com/a-h/templ/runtime"
func Header() templ.Component {
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
return templ_7745c5c3_CtxErr
}
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
if !templ_7745c5c3_IsBuffer {
defer func() {
templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
if templ_7745c5c3_Err == nil {
templ_7745c5c3_Err = templ_7745c5c3_BufErr
}
}()
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var1 := templ.GetChildren(ctx)
if templ_7745c5c3_Var1 == nil {
templ_7745c5c3_Var1 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<header class=\"absolute top-0 left-0 right-0 z-50 flex items-center justify-between p-4 lg:p-6 w-full h-16\"><nav class=\"mx-auto flex max-w-7xl items-center justify-between p-6 lg:px-8\" aria-label=\"Global\"><div class=\"flex flex-1\"><div class=\"flex flex-1\"><a href=\"/\" class=\"text-sm/6 font-semibold text-gray-900\">Return Home <span aria-hidden=\"true\">&rarr;</span></a></div><div class=\"flex lg:hidden\"><button type=\"button\" class=\"-m-2.5 inline-flex items-center justify-center rounded-md p-2.5 text-gray-700\"><span class=\"sr-only\">Open main menu</span> <svg class=\"size-6\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" aria-hidden=\"true\" data-slot=\"icon\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5\"></path></svg></button></div></div><a href=\"/\" class=\"-m-1.5 p-1.5\"><span class=\"sr-only\">Sonr.ID</span> <sl-icon library=\"sonr\" name=\"sonr\" style=\"font-size: 32px; color: #17c2ff;\"></sl-icon></a><div class=\"flex flex-1 justify-end gap-3\"></div></nav></header>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
return templ_7745c5c3_Err
})
}
func NavFooter() templ.Component {
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
return templ_7745c5c3_CtxErr
}
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
if !templ_7745c5c3_IsBuffer {
defer func() {
templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
if templ_7745c5c3_Err == nil {
templ_7745c5c3_Err = templ_7745c5c3_BufErr
}
}()
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var2 := templ.GetChildren(ctx)
if templ_7745c5c3_Var2 == nil {
templ_7745c5c3_Var2 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<footer class=\"flex items-center justify-center w-full h-16 bg-gradient-to-r from-cyan-700 to-cyan-300 px-4 py-2 rounded-xl\"><div class=\"flex items-center gap-3\"><sl-icon library=\"sonr\" name=\"sonr-fill\" class=\"w-8 h-8\"></sl-icon><h1 class=\"text-white text-2xl font-bold\">Sonr.ID</h1></div></footer>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
return templ_7745c5c3_Err
})
}
var _ = templruntime.GeneratedTemplate
+12
View File
@@ -0,0 +1,12 @@
package text
templ TitleDescription(title string, subtitle string) {
<div class="flex flex-col items-center justify-center h-full w-full gap-2.5">
<h1 class="text-2xl md:text-3xl lg:text-4xl font-bold">
{ title }
</h1>
<p class="text-md md:text-lg lg:text-xl font-medium text-gray-500">
{ subtitle }
</p>
</div>
}

Some files were not shown because too many files have changed in this diff Show More