GithubHelp home page GithubHelp logo

ar-page-things's Introduction

ar-page-things

profile edit integration

Configurable metadata:

metadata name min length max length type
bio 0 150 string
avatar 43 43 Arweave TXID
nickname 1 30 string
github 1 38 string - regex'd as GH username
twitter 1 15 string - regex'd as TWTR username
instagram 1 30 string - regex'd as IG username
customUrl 0 a valid string only string not regex'd

This is how the profile editing function handle the action in-contract. here

Transaction Example:

//async code block
const ANS_CONTRACT = "HrPi8hFc7M5dbrtlELfTKwPr53RRrDBgXGdDkp0h-j4";
const newNickname = "pepe";
const newBio = "Pepe the Frog";
const github = "charmful0x";
const custom_url = "https://example.com";

const interaction = `{"function": "updateProfileMetadata", "nickname": "${newNickname}", "bio": "${newBio}", "github": "${github}", "customUrl": "${custom_url}"}`;

const tx = await arweave.createTransaction({ data: String(Date.now()) });
tx.addTag("App-Name", "SmartWeaveAction");
tx.addTag("App-Version", "0.3.0");
tx.addTag("Contract", ANS_CONTRACT);
tx.addTag("Input", interaction);
tx.addTag("Content-Type", "text/plain");
// to 'ensure' that the  TX will not drop when the network is congested
tx.reward = (+tx.reward * 5).toString();

await arweave.transactions.sign(tx);
await arweave.transactions.post(tx);

Notes

  • avatar should be passed an Arweave data TXID that has a image/* MIME type.
  • the contract only handle the passed - defined - metadatas

ar-page-things's People

Contributors

charmful0x avatar

Watchers

 avatar  avatar

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.