Gasless.js
Gasless Dai transfers for browser & Node.js
Install / Use
/learn @mosendo/Gasless.jsREADME
<div align="center">
<h2>Gasless.js</h2>
<blockquote>Send DAI without ETH in your app</blockquote>
</div>
Features
- Gasless DAI transfers via the Mosendo API
- Browser & Node.js support
- Injected web3 provider (e.g. Metamask) support
- EIP712 for readable user signed messages
Getting Started
npm i --save gasless
Usage
Injected Web3 Provider (e.g. Metamask)
import Gasless from 'gasless';
(async ()=>{
await window.ethereum.enable();
const gasless = new Gasless(window.web3.currentProvider);
const gasPrice = await window.web3.eth.getGasPrice();
const daiFee = await gasless.getFee(gasPrice);
const from = window.web3.eth.defaultAccount;
const txHash = await gasless.send(
from, // Sender address (string)
to, // Recipient address (string)
value, // base unit DAI amount (string)
daiFee // Base unit DAI fee. (string)
gasPrice // Tx gas price in Wei. (string)
);
})()
Custom Web3 Provider
Please make sure that your custom provider supports EIP712 signTypedData_v3.
Just replace window.web3.currentProvider in the example above with your custom provider.
Related Skills
node-connect
354.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
112.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
354.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
354.0kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
