Coder Social home page Coder Social logo

mod-protocol / mod Goto Github PK

View Code? Open in Web Editor NEW
49.0 3.0 6.0 5.18 MB

A protocol for Mini-apps that live inside other apps. Starting with Farcaster support

Home Page: https://docs.modprotocol.org

License: MIT License

JavaScript 1.08% TypeScript 82.59% CSS 16.33%
farcaster farcaster-protocol miniapps

mod's Introduction

mod's People

Contributors

davidfurlong avatar stephancill avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

mod's Issues

SDK: Type safety for Mod compatibility

If you partially integrate Mod, and pass RenderEmbed contentMiniApps that require certain APIs that you aren't providing (such as not providing onSendEthTransactionAction) we should consider making that incompatible with the types or logging a warning in dev mode.

feat: isolated and colocated mods

Server side mini-app logic should be isolated and colocated inside the mods/ directory. This will make it possible for mods to exist as standalone packages and help with maintainability and versioning.

Support for numerical comparisons in `Op` type

Mod currently supports the following Ops

type Op = {
    AND?: Op | Op[];
    OR?: Op[];
    NOT?: Op | Op[];
    equals?: string;
    oneOf?: string[];
    notOneOf?: string[];
    contains?: string;
    startsWith?: string;
    endsWith?: string;
    regex?: string;
};

It is missing numerical comparators such as greaterThan, greaterThanOrEquals, lessThan, lessThanOrEquals

Editor automatic embed improvements

The Editor should wait to fetch the open graph api data for any automatic embed being added (automatic embeds are detected in the editor text). If it fails, such as with the domain "www.test.com", then no embed should be automatically added. This also reduces the "loading" duration, which is currently distracting and sometimes 1-2 seconds.

This will also fix the bug where currently it shows as loading when the open graph request failed.

This doesn't solve really slow loading GIFs, which may need another solution

SDK: permissions: improved namespacing

We should ensure we scope new permission definitions to sensible namespaces.

user.wallet.address is ambigious to the chain the address is on, we should rename it.

web3.eth.personal.sign is a much better name since it scopes the signature the the chain (eth).

metadata-indexer: zora.co og images not loading on mobile and desktop

Have been working on including support for Zora links: https://linkcaster.xyz/?page=1&filterUrl=zora.co&timestamp=latest&channel=global&reaction=

Desktop: some images are being blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. I have already added crossorigin="anonymous" for Zora links as suggested by David here https://warpcast.com/df/0xf692e73b

Examples:
https://zora.co/api/thumbnail/7777777/0xd04f3af1fa6be8ac65a43c679e8437d1113408f6/premint-4
https://zora.co/api/thumbnail/7777777/0x433bee782178d2e2cfc3325fd73b1ee60ad20808/premint-2
https://zora.co/api/thumbnail/7777777/0x34a4bd139aa8c17553f0ec3e8aeacc09f4bfb19f/premint-14

Mobile: most Zora og images are not loading. Two examples:
https://warpcast.com/edurubio/0x3dd09056
https://warpcast.com/0xdesigner.eth/0x1327a041

zora-error

metadata-indexer: some media on IPFS accessed via ipfs.io gateway times out

Most commonly happens with zora collect URLs

The opengraph response for https://zora.co/collect/zora:0xde1efa628432ad9cbd400d7fde86314e6b99ec9c/2 is:
"mediaUrl": "https://ipfs.io/ipfs/bafybeibg426qfzmc5v5wpb3mftlunwapmfjbljtam4coo4wzbpovvu5ioi" which comes from the opensea API.

Replacing the ipfs.io gateway with cloudflare-ipfs.com fixes the issue

EmbedsEditor should use RenderMiniApps component

We should Embed rendering consistent between creating a cast and rendering a cast, with the exception that we need to consider

  1. performance of metadata loading (at render time it'll be cached, at creation time it won't be pre-cached)
  2. interacting with the Mini-app should probably not trigger all actions (we need a preview mode or to prevent actions or something)

chore: refactor EmbedsEditor to render miniapp preview

Currently the EmbedsEditor duplicates the logic of rendering detected embeds.

It should make use of the miniapp registry to detect and render a given embed URL and any pre-defined metadata. If no metadata is pre-defined, it should fetch from the OpenGraph API endpoint and then retry rendering with miniapps.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.