Kwil Extension for the MEM protocol
git clone https://github.com/decentldotland/mem-kwil-ext.git
cd mem-sdk
npm install && npm run build
docker build -t mem_kwil .
The mem-kwil-ext
is a Kwil Extension designed to enable the utilization of MEM serverless functions within Kwil SQL databases. In its present iteration, this extension exclusively facilitates MEM write operations from a Kwil DB.
It offers support for both MEM's mainnet and testnet RPCs, along with MEM Named Functions resolution. The primary method employed by the extension is write()
, which accepts the MEM Input object in a stringified JSON format.
In this Kuneiform database example, we import the mem_kwil
extension as mem
, then submit a write
interaction to the ans.mem MEM function. The extension method returns the MEM TXID in case the interaction succeeds.
database mem_kwil_test;
use mem_kwil {
network: 'mainnet',
function_id: 'ans.mem'
} as mem;
table reqs {
txid text primary notnull
}
action writeMem() public {
$txid = mem.write('{"function": "mint", "domain": "memkwilext"}');
INSERT INTO reqs
VALUES($txid);
}
This repository is licensed under the MIT License