Transaction
585DB8DBCF7953…219387F0ABB5
Block 25,923 · index 1 · indexed
Summary
- Hash
- 585DB8DBCF79534BD22F174E59ECCC0B720CBEA6E1444B34A75C219387F0ABB5
- Block
- 25,923
- Size
- 2336 bytes
- Gas used
- 7,287,490 / 8,745,048
- Fee
- 1000000ugnot
- Memo
- gnopublish
- Status
- success
Messages
- Package
- gno.land/p/moul/web25/v0
Arguments · 9
- #1web25
- #2README.md
- #3# `gno.land/p/moul/web25/v0` _TODO: describe this package._ <!-- BEGIN GNOCONTRACTS FOOTER (generated by `make readmes`; do not edit below) --> --- Part of **[moul/gno-contracts](https://github.com/moul/gno-contracts)** — moul's versioned gno.land contracts. See the repository for the full catalog, build/test tooling, and usage. **Dependency graph:**  > ⚠️ **Disclaimer:** provided as-is, without warranty; not security-audited. Full disclaimer: [DISCLAIMER](https://github.com/moul/gno-contracts/blob/main/DISCLAIMER.md). <!-- END GNOCONTRACTS FOOTER -->
- #4gnomod.toml
- #5module = "gno.land/p/moul/web25/v0" gno = "0.9"
- #6web25.gno
- #7// Pacakge web25 provides an opinionated way to register an external web2 // frontend to provide a "better" web2.5 experience. package web25 import ( "strings" "gno.land/p/moul/realmpath/v0" ) type Config struct { CID string URL string Text string } func (c *Config) SetRemoteFrontendByURL(url string) { c.CID = "" c.URL = url } func (c *Config) SetRemoteFrontendByCID(cid string) { c.CID = cid c.URL = "" } func (c Config) GetLink() string { if c.CID != "" { return "https://ipfs.io/ipfs/" + c.CID } return c.URL } const DefaultText = "Click [here]({link}) to visit the full rendering experience.\n" // Render displays a frontend link at the top of your realm's Render function in // a concistent way to help gno visitors to have a consistent experience. // // if query is not nil, then it will check if it's not disable by ?no-web25, so // that you can call the render function from an external point of view. func (c Config) Render(path string) string { if realmpath.Parse(path).Query.Get("no-web25") == "1" { return "" } text := c.Text if text == "" { text = DefaultText } text = strings.ReplaceAll(text, "{link}", c.GetLink()) return text }
- #8/gno.MemPackageType
- #9 MPUserProd
Result log
msg:0,success:true,log:,events:[]