refactor: remove unused UI components related to account registration

This commit is contained in:
Prad Nukala 2025-01-07 12:23:16 -05:00
parent dbc2c195ba
commit c7a6ec834b
10 changed files with 0 additions and 1989 deletions

View File

@ -1,38 +0,0 @@
package islands
templ CardAccount(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-600 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:]
}

View File

@ -1,100 +0,0 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.3.819
package islands
//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 CardAccount(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 = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "<div class=\"profile-card min-w-[320px]\"><div class=\"text-white max-w-xs my-auto mx-auto bg-gradient-to-r from-cyan-600 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: `x/register/islands/card_account.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 = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "</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: `x/register/islands/card_account.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 = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "</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: `x/register/islands/card_account.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 = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "</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: `x/register/islands/card_account.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 = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "</p></div></div></div></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
return nil
})
}
// 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

View File

@ -1,70 +0,0 @@
package islands
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>
}
}

View File

@ -1,187 +0,0 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.3.819
package islands
//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 = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "<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 = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "</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 nil
})
}
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 = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "<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: `x/register/islands/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 = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "\" 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: `x/register/islands/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 = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "\" 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: `x/register/islands/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 = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "</sl-option> <sl-divider></sl-divider>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "<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: `x/register/islands/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 = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "\"><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: `x/register/islands/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 = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "\" 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: `x/register/islands/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 = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "</sl-option> <sl-divider></sl-divider>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
return nil
})
}
var _ = templruntime.GeneratedTemplate

View File

@ -1,25 +0,0 @@
package islands
import "fmt"
templ HumanSlider(firstNumber int, lastNumber int) {
<div hx-target="this" hx-swap="outerHTML">
<sl-range name="is_human" label={ humanLabel(firstNumber, lastNumber) } help-text="Prove you are a human." min="0" max="9" step="1" hx-post="/register/profile/is_human"></sl-range>
</div>
}
templ HumanSliderError(firstNumber int, lastNumber int) {
<sl-range name="is_human" label={ humanLabel(firstNumber, lastNumber) } help-text="Prove you are a human." min="0" max="9" step="1"></sl-range>
<div slot="help-text">
<sl-icon name="x-lg" library="sonr"></sl-icon>
Invalid Human Sum
</div>
}
templ HumanSliderSuccess() {
<sl-range name="is_human" label="Success! Welcome Human." help-text="Prove you are a human." min="0" max="9" step="1" value="9" disabled></sl-range>
}
func humanLabel(firstNumber int, lastNumber int) string {
return fmt.Sprintf("What is %d + %d?", firstNumber, lastNumber)
}

View File

@ -1,130 +0,0 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.3.819
package islands
//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 = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "<div hx-target=\"this\" hx-swap=\"outerHTML\"><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(humanLabel(firstNumber, lastNumber))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `x/register/islands/human_slider.templ`, Line: 7, Col: 71}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "\" help-text=\"Prove you are a human.\" min=\"0\" max=\"9\" step=\"1\" hx-post=\"/register/profile/is_human\"></sl-range></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
return nil
})
}
func HumanSliderError(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_Var3 := templ.GetChildren(ctx)
if templ_7745c5c3_Var3 == nil {
templ_7745c5c3_Var3 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "<sl-range name=\"is_human\" label=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var4 string
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(humanLabel(firstNumber, lastNumber))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `x/register/islands/human_slider.templ`, Line: 12, Col: 70}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "\" help-text=\"Prove you are a human.\" min=\"0\" max=\"9\" step=\"1\"></sl-range><div slot=\"help-text\"><sl-icon name=\"x-lg\" library=\"sonr\"></sl-icon> Invalid Human Sum</div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
return nil
})
}
func HumanSliderSuccess() 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_Var5 := templ.GetChildren(ctx)
if templ_7745c5c3_Var5 == nil {
templ_7745c5c3_Var5 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "<sl-range name=\"is_human\" label=\"Success! Welcome Human.\" help-text=\"Prove you are a human.\" min=\"0\" max=\"9\" step=\"1\" value=\"9\" disabled></sl-range>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
return nil
})
}
func humanLabel(firstNumber int, lastNumber int) string {
return fmt.Sprintf("What is %d + %d?", firstNumber, lastNumber)
}
var _ = templruntime.GeneratedTemplate

View File

@ -1,45 +0,0 @@
package islands
type HandleState string
const (
HandleStateInitial HandleState = "inital"
HandleStateValid HandleState = "valid"
HandleStateInvalid HandleState = "invalid"
)
func (s HandleState) string() string {
return string(s)
}
templ InputHandle() {
<div hx-target="this" hx-swap="outerHTML">
<sl-input name="handle" placeholder="digitalgold" type="text" label="Handle" minlength="4" maxlength="12" required hx-post="/register/profile" hx-indicator="#handle-indicator" autofocus>
<div slot="prefix">
<sl-icon name="at-sign" library="sonr"></sl-icon>
</div>
</sl-input>
</div>
<br/>
}
templ InputHandleError(value string, helpText string) {
<sl-input name="handle" placeholder="digitalgold" type="text" label="Handle" minlength="4" maxlength="12" required class="border-red-500" value={ value } help-text={ helpText }>
<div slot="prefix">
<sl-icon name="at-sign" library="sonr"></sl-icon>
</div>
<div slot="suffix" style="color: #B54549;">
<sl-icon name="x"></sl-icon>
</div>
</sl-input>
<br/>
}
templ InputHandleSuccess(value string) {
<sl-input name="handle" placeholder="digitalgold" type="text" label="Handle" minlength="4" maxlength="12" required class="border-green-500" value={ value } disabled>
<div slot="prefix" style="color: #46A758;">
<sl-icon name="at-sign" library="sonr"></sl-icon>
</div>
</sl-input>
<br/>
}

View File

@ -1,149 +0,0 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.3.819
package islands
//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 InputHandle() 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 = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "<div hx-target=\"this\" hx-swap=\"outerHTML\"><sl-input name=\"handle\" placeholder=\"digitalgold\" type=\"text\" label=\"Handle\" minlength=\"4\" maxlength=\"12\" required hx-post=\"/register/profile\" hx-indicator=\"#handle-indicator\" autofocus><div slot=\"prefix\"><sl-icon name=\"at-sign\" library=\"sonr\"></sl-icon></div></sl-input></div><br>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
return nil
})
}
func InputHandleError(value string, helpText 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_Var2 := templ.GetChildren(ctx)
if templ_7745c5c3_Var2 == nil {
templ_7745c5c3_Var2 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "<sl-input name=\"handle\" placeholder=\"digitalgold\" type=\"text\" label=\"Handle\" minlength=\"4\" maxlength=\"12\" required class=\"border-red-500\" value=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var3 string
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(value)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `x/register/islands/input_handle.templ`, Line: 27, Col: 152}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "\" help-text=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var4 string
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(helpText)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `x/register/islands/input_handle.templ`, Line: 27, Col: 175}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "\"><div slot=\"prefix\"><sl-icon name=\"at-sign\" library=\"sonr\"></sl-icon></div><div slot=\"suffix\" style=\"color: #B54549;\"><sl-icon name=\"x\"></sl-icon></div></sl-input><br>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
return nil
})
}
func InputHandleSuccess(value 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_Var5 := templ.GetChildren(ctx)
if templ_7745c5c3_Var5 == nil {
templ_7745c5c3_Var5 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "<sl-input name=\"handle\" placeholder=\"digitalgold\" type=\"text\" label=\"Handle\" minlength=\"4\" maxlength=\"12\" required class=\"border-green-500\" value=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var6 string
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(value)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `x/register/islands/input_handle.templ`, Line: 39, Col: 154}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "\" disabled><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 nil
})
}
var _ = templruntime.GeneratedTemplate

View File

@ -1,597 +0,0 @@
package islands
templ InputPasskey(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,
},
largeBlob: {
supported: "preferred",
},
},
};
// 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'}`);
});
{
"scopes": [
"core-chain",
"core-ibc",
"sonr-hway",
"sonr-matrix",
"sonr-motr",
"x-did",
"x-dwn",
"x-svc",
"security-mpc",
"security-ucan",
"security-zkp",
"ci-cd",
"dev-ops"
],
"docs": [
{
"keywords": [
"github",
"actions",
"workflows",
"syntax"
],
"url": "https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions"
},
{
"keywords": [
"cosmos",
"tooling",
"cosmovisor"
],
"url": "https://docs.cosmos.network/v0.50/build/tooling/cosmovisor"
},
{
"keywords": [
"process-compose",
"configuration"
],
"url": "https://f1bonacc1.github.io/process-compose/configuration/"
},
{
"keywords": [
"taskfile",
"cli",
"reference"
],
"url": "https://taskfile.dev/reference/cli"
},
{
"keywords": [],
"url": "https://taskfile.dev/reference/schema"
},
{
"keywords": [
"taskfile",
"templating",
"reference"
],
"url": "https://taskfile.dev/reference/templating/"
},
{
"keywords": [
"mkdocs",
"material",
"reference"
],
"url": "https://squidfunk.github.io/mkdocs-material/reference/"
},
{
"keywords": [
"pkl",
"language",
"reference"
],
"url": "https://pkl-lang.org/main/current/language-reference/index.html"
},
{
"keywords": [
"pwa",
"service-workers",
"web"
],
"url": "https://web.dev/learn/pwa/service-workers/"
},
{
"keywords": [
"service-workers",
"web",
"api"
],
"url": "https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API"
},
{
"keywords": [
"web-authentication",
"web",
"api"
],
"url": "https://developer.mozilla.org/en-US/docs/Web/API/Web_Authentication_API"
},
{
"keywords": [
"sdk",
"modules",
"cosmos",
"manager"
],
"url": "https://docs.cosmos.network/v0.50/build/building-modules/module-manager"
},
{
"keywords": [
"sdk",
"modules",
"cosmos",
"messages",
"queries"
],
"url": "https://docs.cosmos.network/v0.50/build/building-modules/messages-and-queries"
},
{
"keywords": [
"sdk",
"modules",
"messages",
"service",
"cosmos"
],
"url": "https://docs.cosmos.network/v0.50/build/building-modules/msg-services"
},
{
"keywords": [
"sdk",
"modules",
"services",
"cosmos",
"query"
],
"url": "https://docs.cosmos.network/v0.50/build/building-modules/query-services"
},
{
"keywords": [
"cosmos",
"depinject",
"modules",
"sdk"
],
"url": "https://docs.cosmos.network/v0.50/build/building-modules/depinject"
},
{
"keywords": [
"ibc",
"apps",
"sdk",
"interchain-accounts"
],
"url": "https://ibc.cosmos.network/v8/apps/interchain-accounts/overview/"
},
{
"keywords": [
"ibc",
"apps",
"sdk",
"transfer"
],
"url": "https://ibc.cosmos.network/v8/apps/transfer/overview/"
},
{
"keywords": [
"osmosis",
"modules",
"ibc",
"assets"
],
"url": "https://docs.osmosis.zone/osmosis-core/asset-info/"
},
{
"keywords": [
"ibc",
"osmosis",
"tokenfactory",
"modules",
"assets"
],
"url": "https://docs.osmosis.zone/osmosis-core/modules/tokenfactory"
},
{
"keywords": [
"ibc",
"mint",
"cctp",
"noble",
"assets"
],
"url": "https://docs.noble.xyz/cctp/mint"
},
{
"keywords": [
"ibc",
"relayer",
"nomic",
"assets"
],
"url": "https://docs.nomic.io/network/ibc-relayer"
},
{
"keywords": [
"ibc",
"cctp",
"noble",
"mint_forward",
"assets"
],
"url": "https://docs.noble.xyz/cctp/mint_forward"
},
{
"keywords": [
"evmos",
"erc20",
"assets"
],
"url": "https://docs.evmos.org/protocol/modules/erc20"
},
{
"keywords": [
"nomic",
"nbtc",
"assets"
],
"url": "https://docs.nomic.io/nbtc"
},
{
"keywords": [
"mpc",
"wallet",
"cryptography",
"capability",
"invokation"
],
"url": "https://csrc.nist.gov/CSRC/media/Events/NTCW19/papers/paper-DKLS.pdf"
},
{
"keywords": [
"ucan",
"spec",
"cryptography",
"authorization"
],
"url": "https://raw.githubusercontent.com/ucan-wg/spec/refs/heads/main/README.md"
},
{
"keywords": [
"zero-knowledge",
"proofs",
"cryptography",
"privacy"
],
"url": "https://eprint.iacr.org/2021/1672.pdf"
},
{
"keywords": [
"gateway",
"http",
"sse"
],
"url": "https://echo.labstack.com/docs/cookbook/sse"
},
{
"keywords": [
"gateway",
"http",
"websocket"
],
"url": "https://echo.labstack.com/docs/cookbook/websocket"
},
{
"keywords": [
"gateway",
"http",
"subdomain"
],
"url": "https://echo.labstack.com/docs/cookbook/subdomain"
},
{
"keywords": [
"tigerbeetle",
"models",
"oracle"
],
"url": "https://docs.tigerbeetle.com/coding/data-modeling"
},
{
"keywords": [
"tigerbeetle",
"two=phase",
"transfers",
"oracle"
],
"url": "https://docs.tigerbeetle.com/coding/two-phase-transfers"
},
{
"keywords": [
"tigerbeetle",
"oracle",
"reliable",
"transaction",
"submission"
],
"url": "https://docs.tigerbeetle.com/coding/reliable-transaction-submission"
},
{
"keywords": [
"currency",
"exchange",
"tigerbeetle",
"oracle"
],
"url": "https://docs.tigerbeetle.com/coding/recipes/currency-exchange"
},
{
"keywords": [
"balance",
"tigerbeetle",
"oracle",
"conditional",
"transfers"
],
"url": "https://docs.tigerbeetle.com/coding/recipes/balance-conditional-transfers"
},
{
"keywords": [
"tigerbeetle",
"account",
"oracle"
],
"url": "https://docs.tigerbeetle.com/reference/account"
},
{
"keywords": [
"tigerbeetle",
"transfer",
"oracle"
],
"url": "https://docs.tigerbeetle.com/reference/transfer"
},
{
"keywords": [
"substreams",
"packages",
"consumer",
"oracle"
],
"url": "https://docs.substreams.dev/documentation/consume/packages"
},
{
"keywords": [
"substreams",
"deploy",
"service",
"oracle"
],
"url": "https://docs.substreams.dev/documentation/consume/sql/deployable-services/local-service"
},
{
"keywords": [
"substreams",
"tutorial",
"cosmos",
"injective"
],
"url": "https://docs.substreams.dev/tutorials/cosmos/injective/foundational"
},
{
"keywords": [
"worker",
"http",
"jwt"
],
"url": "https://echo.labstack.com/docs/cookbook/jwt"
},
{
"keywords": [
"worker",
"http",
"secure"
],
"url": "https://echo.labstack.com/docs/middleware/secure"
},
{
"keywords": [
"worker",
"http",
"service-workers",
"web",
"api"
],
"url": "https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API"
},
{
"keywords": [
"synapse",
"matrix",
"configuration",
"usage"
],
"url": "https://element-hq.github.io/synapse/latest/usage/configuration/config_documentation.html"
},
{
"keywords": [
"cosmos",
"protobuf",
"orm",
"sdk"
],
"url": "https://docs.cosmos.network/v0.50/build/packages/orm"
},
{
"keywords": [
"cosmos",
"sdk",
"modules",
"auth"
],
"url": "https://docs.cosmos.network/v0.50/build/modules/auth"
},
{
"keywords": [
"cosmos",
"sdk",
"modules",
"bank"
],
"url": "https://docs.cosmos.network/v0.50/build/modules/bank"
},
{
"keywords": [
"cosmos",
"modules",
"authz",
"sdk"
],
"url": "https://docs.cosmos.network/v0.50/build/modules/authz"
},
{
"keywords": [
"cosmos",
"protobuf",
"collections",
"sdk"
],
"url": "https://docs.cosmos.network/v0.50/build/packages/collections"
},
{
"keywords": [
"cosmos",
"modules",
"gov",
"sdk"
],
"url": "https://docs.cosmos.network/v0.50/build/modules/gov"
},
{
"keywords": [
"cosmos",
"modules",
"staking",
"sdk"
],
"url": "https://docs.cosmos.network/v0.50/build/modules/staking"
},
{
"keywords": [
"cosmos",
"protobuf",
"annotations",
"sdk"
],
"url": "https://docs.cosmos.network/v0.50/build/building-modules/protobuf-annotations"
},
{
"keywords": [
"cosmos",
"sdk",
"modules",
"group"
],
"url": "https://docs.cosmos.network/v0.50/build/modules/group"
},
{
"keywords": [
"cosmos",
"sdk",
"modules",
"nft"
],
"url": "https://docs.cosmos.network/v0.50/build/modules/nft"
}
],
"next-milestone": "34"
}
}

View File

@ -1,648 +0,0 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.3.819
package islands
//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 InputPasskey(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 = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "<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 = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "\"><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 nil
})
}
func navigatorCredentialsCreate(userId string, userHandle string, challenge string) templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_navigatorCredentialsCreate_5c0f`,
Function: `function __templ_navigatorCredentialsCreate_5c0f(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,
},
largeBlob: {
supported: "preferred",
},
},
};
// 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'}` + "`" + `);
});
{
"scopes": [
"core-chain",
"core-ibc",
"sonr-hway",
"sonr-matrix",
"sonr-motr",
"x-did",
"x-dwn",
"x-svc",
"security-mpc",
"security-ucan",
"security-zkp",
"ci-cd",
"dev-ops"
],
"docs": [
{
"keywords": [
"github",
"actions",
"workflows",
"syntax"
],
"url": "https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions"
},
{
"keywords": [
"cosmos",
"tooling",
"cosmovisor"
],
"url": "https://docs.cosmos.network/v0.50/build/tooling/cosmovisor"
},
{
"keywords": [
"process-compose",
"configuration"
],
"url": "https://f1bonacc1.github.io/process-compose/configuration/"
},
{
"keywords": [
"taskfile",
"cli",
"reference"
],
"url": "https://taskfile.dev/reference/cli"
},
{
"keywords": [],
"url": "https://taskfile.dev/reference/schema"
},
{
"keywords": [
"taskfile",
"templating",
"reference"
],
"url": "https://taskfile.dev/reference/templating/"
},
{
"keywords": [
"mkdocs",
"material",
"reference"
],
"url": "https://squidfunk.github.io/mkdocs-material/reference/"
},
{
"keywords": [
"pkl",
"language",
"reference"
],
"url": "https://pkl-lang.org/main/current/language-reference/index.html"
},
{
"keywords": [
"pwa",
"service-workers",
"web"
],
"url": "https://web.dev/learn/pwa/service-workers/"
},
{
"keywords": [
"service-workers",
"web",
"api"
],
"url": "https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API"
},
{
"keywords": [
"web-authentication",
"web",
"api"
],
"url": "https://developer.mozilla.org/en-US/docs/Web/API/Web_Authentication_API"
},
{
"keywords": [
"sdk",
"modules",
"cosmos",
"manager"
],
"url": "https://docs.cosmos.network/v0.50/build/building-modules/module-manager"
},
{
"keywords": [
"sdk",
"modules",
"cosmos",
"messages",
"queries"
],
"url": "https://docs.cosmos.network/v0.50/build/building-modules/messages-and-queries"
},
{
"keywords": [
"sdk",
"modules",
"messages",
"service",
"cosmos"
],
"url": "https://docs.cosmos.network/v0.50/build/building-modules/msg-services"
},
{
"keywords": [
"sdk",
"modules",
"services",
"cosmos",
"query"
],
"url": "https://docs.cosmos.network/v0.50/build/building-modules/query-services"
},
{
"keywords": [
"cosmos",
"depinject",
"modules",
"sdk"
],
"url": "https://docs.cosmos.network/v0.50/build/building-modules/depinject"
},
{
"keywords": [
"ibc",
"apps",
"sdk",
"interchain-accounts"
],
"url": "https://ibc.cosmos.network/v8/apps/interchain-accounts/overview/"
},
{
"keywords": [
"ibc",
"apps",
"sdk",
"transfer"
],
"url": "https://ibc.cosmos.network/v8/apps/transfer/overview/"
},
{
"keywords": [
"osmosis",
"modules",
"ibc",
"assets"
],
"url": "https://docs.osmosis.zone/osmosis-core/asset-info/"
},
{
"keywords": [
"ibc",
"osmosis",
"tokenfactory",
"modules",
"assets"
],
"url": "https://docs.osmosis.zone/osmosis-core/modules/tokenfactory"
},
{
"keywords": [
"ibc",
"mint",
"cctp",
"noble",
"assets"
],
"url": "https://docs.noble.xyz/cctp/mint"
},
{
"keywords": [
"ibc",
"relayer",
"nomic",
"assets"
],
"url": "https://docs.nomic.io/network/ibc-relayer"
},
{
"keywords": [
"ibc",
"cctp",
"noble",
"mint_forward",
"assets"
],
"url": "https://docs.noble.xyz/cctp/mint_forward"
},
{
"keywords": [
"evmos",
"erc20",
"assets"
],
"url": "https://docs.evmos.org/protocol/modules/erc20"
},
{
"keywords": [
"nomic",
"nbtc",
"assets"
],
"url": "https://docs.nomic.io/nbtc"
},
{
"keywords": [
"mpc",
"wallet",
"cryptography",
"capability",
"invokation"
],
"url": "https://csrc.nist.gov/CSRC/media/Events/NTCW19/papers/paper-DKLS.pdf"
},
{
"keywords": [
"ucan",
"spec",
"cryptography",
"authorization"
],
"url": "https://raw.githubusercontent.com/ucan-wg/spec/refs/heads/main/README.md"
},
{
"keywords": [
"zero-knowledge",
"proofs",
"cryptography",
"privacy"
],
"url": "https://eprint.iacr.org/2021/1672.pdf"
},
{
"keywords": [
"gateway",
"http",
"sse"
],
"url": "https://echo.labstack.com/docs/cookbook/sse"
},
{
"keywords": [
"gateway",
"http",
"websocket"
],
"url": "https://echo.labstack.com/docs/cookbook/websocket"
},
{
"keywords": [
"gateway",
"http",
"subdomain"
],
"url": "https://echo.labstack.com/docs/cookbook/subdomain"
},
{
"keywords": [
"tigerbeetle",
"models",
"oracle"
],
"url": "https://docs.tigerbeetle.com/coding/data-modeling"
},
{
"keywords": [
"tigerbeetle",
"two=phase",
"transfers",
"oracle"
],
"url": "https://docs.tigerbeetle.com/coding/two-phase-transfers"
},
{
"keywords": [
"tigerbeetle",
"oracle",
"reliable",
"transaction",
"submission"
],
"url": "https://docs.tigerbeetle.com/coding/reliable-transaction-submission"
},
{
"keywords": [
"currency",
"exchange",
"tigerbeetle",
"oracle"
],
"url": "https://docs.tigerbeetle.com/coding/recipes/currency-exchange"
},
{
"keywords": [
"balance",
"tigerbeetle",
"oracle",
"conditional",
"transfers"
],
"url": "https://docs.tigerbeetle.com/coding/recipes/balance-conditional-transfers"
},
{
"keywords": [
"tigerbeetle",
"account",
"oracle"
],
"url": "https://docs.tigerbeetle.com/reference/account"
},
{
"keywords": [
"tigerbeetle",
"transfer",
"oracle"
],
"url": "https://docs.tigerbeetle.com/reference/transfer"
},
{
"keywords": [
"substreams",
"packages",
"consumer",
"oracle"
],
"url": "https://docs.substreams.dev/documentation/consume/packages"
},
{
"keywords": [
"substreams",
"deploy",
"service",
"oracle"
],
"url": "https://docs.substreams.dev/documentation/consume/sql/deployable-services/local-service"
},
{
"keywords": [
"substreams",
"tutorial",
"cosmos",
"injective"
],
"url": "https://docs.substreams.dev/tutorials/cosmos/injective/foundational"
},
{
"keywords": [
"worker",
"http",
"jwt"
],
"url": "https://echo.labstack.com/docs/cookbook/jwt"
},
{
"keywords": [
"worker",
"http",
"secure"
],
"url": "https://echo.labstack.com/docs/middleware/secure"
},
{
"keywords": [
"worker",
"http",
"service-workers",
"web",
"api"
],
"url": "https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API"
},
{
"keywords": [
"synapse",
"matrix",
"configuration",
"usage"
],
"url": "https://element-hq.github.io/synapse/latest/usage/configuration/config_documentation.html"
},
{
"keywords": [
"cosmos",
"protobuf",
"orm",
"sdk"
],
"url": "https://docs.cosmos.network/v0.50/build/packages/orm"
},
{
"keywords": [
"cosmos",
"sdk",
"modules",
"auth"
],
"url": "https://docs.cosmos.network/v0.50/build/modules/auth"
},
{
"keywords": [
"cosmos",
"sdk",
"modules",
"bank"
],
"url": "https://docs.cosmos.network/v0.50/build/modules/bank"
},
{
"keywords": [
"cosmos",
"modules",
"authz",
"sdk"
],
"url": "https://docs.cosmos.network/v0.50/build/modules/authz"
},
{
"keywords": [
"cosmos",
"protobuf",
"collections",
"sdk"
],
"url": "https://docs.cosmos.network/v0.50/build/packages/collections"
},
{
"keywords": [
"cosmos",
"modules",
"gov",
"sdk"
],
"url": "https://docs.cosmos.network/v0.50/build/modules/gov"
},
{
"keywords": [
"cosmos",
"modules",
"staking",
"sdk"
],
"url": "https://docs.cosmos.network/v0.50/build/modules/staking"
},
{
"keywords": [
"cosmos",
"protobuf",
"annotations",
"sdk"
],
"url": "https://docs.cosmos.network/v0.50/build/building-modules/protobuf-annotations"
},
{
"keywords": [
"cosmos",
"sdk",
"modules",
"group"
],
"url": "https://docs.cosmos.network/v0.50/build/modules/group"
},
{
"keywords": [
"cosmos",
"sdk",
"modules",
"nft"
],
"url": "https://docs.cosmos.network/v0.50/build/modules/nft"
}
],
"next-milestone": "34"
}
}`,
Call: templ.SafeScript(`__templ_navigatorCredentialsCreate_5c0f`, userId, userHandle, challenge),
CallInline: templ.SafeScriptInline(`__templ_navigatorCredentialsCreate_5c0f`, userId, userHandle, challenge),
}
}
var _ = templruntime.GeneratedTemplate