Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mem-sdk

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mem-sdk - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

2

dist/index.cjs.js

@@ -1,1 +0,1 @@

"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i="https://mem-cli-server-482a8c7c1299.herokuapp.com/mem-cli";function u(o,t){const e=o.split("").map(s=>s.charCodeAt(0)),n={contractOwner:"",contentType:"application/javascript",contractSrc:e,initState:t},a=[{name:"Content-Type",value:"application/javascript"},{name:"Owner",value:""},{name:"App-Name",value:"EM"},{name:"Type",value:"Serverless-Function"},{name:"EM-Bundled",value:"true"},{name:"Size",value:String(e.length)}];return{dataTx:n,tags:a}}class d{async readFunction(t){const e=`https://api.mem.tech/api/state/${t}`,a=await fetch(e,{headers:{"Content-Type":"application/json"}});if(a.ok)return await a.json();throw new Error(a.statusText)}async writeFunction(t,e){const n="https://api.mem.tech/api/transactions",c={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({functionId:t,inputs:[{input:e}]})},r=await fetch(n,c);if(r.ok)return await r.json();throw new Error(r.statusText)}async deployFunction(t,e){const n=JSON.stringify(u(t,e)),s=await fetch(i,{method:"post",url:i,body:n,headers:{Accept:"application/json","Content-Type":"application/json"},maxContentLength:1e8,maxBodyLength:1e9});if(s.ok)return{id:(await s.json()).txid};throw new Error(s.statusText)}}class p extends d{async read(t){return await this.readFunction(t)}async write(t,e){return await this.writeFunction(t,e)}async deploy(t,e){return await this.deployFunction(t,e)}}class l extends p{}exports.Actions=p;exports.Mem=l;
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i="https://mem-cli-server-482a8c7c1299.herokuapp.com/mem-cli";function m(o,t){const e=o.split("").map(a=>a.charCodeAt(0)),s={contractOwner:"",contentType:"application/javascript",contractSrc:e,initState:t},n=[{name:"Content-Type",value:"application/javascript"},{name:"Owner",value:""},{name:"App-Name",value:"EM"},{name:"Type",value:"Serverless-Function"},{name:"EM-Bundled",value:"true"},{name:"Size",value:String(e.length)}];return{dataTx:s,tags:n}}async function p(o){var t;try{const e=o.split(".mem")[0],n=await fetch("https://api.mem.tech/api/state/GJn1h75nIAyMW5XWgzraL-Ldxr2Zb38WlLEVwk6CBDs",{headers:{"Content-Type":"application/json"}});if(n.ok){const a=(t=await n.json())==null?void 0:t.names;if(e in a)return a[e]}throw new Error(n.statusText)}catch{return null}}class h{async readFunction(t){t.endsWith(".mem")&&(t=await p(t));const e=`https://api.mem.tech/api/state/${t}`,n=await fetch(e,{headers:{"Content-Type":"application/json"}});if(n.ok)return await n.json();throw new Error(n.statusText)}async writeFunction(t,e){t.endsWith(".mem")&&(t=await p(t));const s="https://api.mem.tech/api/transactions",c={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({functionId:t,inputs:[{input:e}]})},r=await fetch(s,c);if(r.ok)return await r.json();throw new Error(r.statusText)}async deployFunction(t,e){const s=JSON.stringify(m(t,e)),a=await fetch(i,{method:"post",url:i,body:s,headers:{Accept:"application/json","Content-Type":"application/json"},maxContentLength:1e8,maxBodyLength:1e9});if(a.ok)return{id:(await a.json()).txid};throw new Error(a.statusText)}}class u extends h{async read(t){return await this.readFunction(t)}async write(t,e){return await this.writeFunction(t,e)}async deploy(t,e){return await this.deployFunction(t,e)}}class l extends u{}exports.Actions=u;exports.Mem=l;
const i = "https://mem-cli-server-482a8c7c1299.herokuapp.com/mem-cli";
function p(o, t) {
const n = o.split("").map((s) => s.charCodeAt(0)), e = {
function u(o, t) {
const e = o.split("").map((a) => a.charCodeAt(0)), s = {
contractOwner: "",
contentType: "application/javascript",
contractSrc: n,
contractSrc: e,
initState: t
}, a = [
}, n = [
{ name: "Content-Type", value: "application/javascript" },

@@ -14,17 +14,35 @@ { name: "Owner", value: "" },

{ name: "EM-Bundled", value: "true" },
{ name: "Size", value: String(n.length) }
{ name: "Size", value: String(e.length) }
];
return { dataTx: e, tags: a };
return { dataTx: s, tags: n };
}
class u {
async function p(o) {
var t;
try {
const e = o.split(".mem")[0], n = await fetch("https://api.mem.tech/api/state/GJn1h75nIAyMW5XWgzraL-Ldxr2Zb38WlLEVwk6CBDs", { headers: {
"Content-Type": "application/json"
} });
if (n.ok) {
const a = (t = await n.json()) == null ? void 0 : t.names;
if (e in a)
return a[e];
}
throw new Error(n.statusText);
} catch {
return null;
}
}
class h {
async readFunction(t) {
const n = `https://api.mem.tech/api/state/${t}`, a = await fetch(n, { headers: {
t.endsWith(".mem") && (t = await p(t));
const e = `https://api.mem.tech/api/state/${t}`, n = await fetch(e, { headers: {
"Content-Type": "application/json"
} });
if (a.ok)
return await a.json();
throw new Error(a.statusText);
if (n.ok)
return await n.json();
throw new Error(n.statusText);
}
async writeFunction(t, n) {
const e = "https://api.mem.tech/api/transactions", c = {
async writeFunction(t, e) {
t.endsWith(".mem") && (t = await p(t));
const s = "https://api.mem.tech/api/transactions", c = {
method: "POST",

@@ -38,7 +56,7 @@ headers: {

{
input: n
input: e
}
]
})
}, r = await fetch(e, c);
}, r = await fetch(s, c);
if (r.ok)

@@ -48,7 +66,7 @@ return await r.json();

}
async deployFunction(t, n) {
const e = JSON.stringify(p(t, n)), s = await fetch(i, {
async deployFunction(t, e) {
const s = JSON.stringify(u(t, e)), a = await fetch(i, {
method: "post",
url: i,
body: e,
body: s,
headers: {

@@ -61,23 +79,23 @@ Accept: "application/json",

});
if (s.ok)
return { id: (await s.json()).txid };
throw new Error(s.statusText);
if (a.ok)
return { id: (await a.json()).txid };
throw new Error(a.statusText);
}
}
class d extends u {
class m extends h {
async read(t) {
return await this.readFunction(t);
}
async write(t, n) {
return await this.writeFunction(t, n);
async write(t, e) {
return await this.writeFunction(t, e);
}
async deploy(t, n) {
return await this.deployFunction(t, n);
async deploy(t, e) {
return await this.deployFunction(t, e);
}
}
class h extends d {
class l extends m {
}
export {
d as Actions,
h as Mem
m as Actions,
l as Mem
};

@@ -1,1 +0,1 @@

(function(a,i){typeof exports=="object"&&typeof module<"u"?i(exports):typeof define=="function"&&define.amd?define(["exports"],i):(a=typeof globalThis<"u"?globalThis:a||self,i(a["mem-sdk"]={}))})(this,function(a){"use strict";const i="https://mem-cli-server-482a8c7c1299.herokuapp.com/mem-cli";function d(c,t){const e=c.split("").map(o=>o.charCodeAt(0)),n={contractOwner:"",contentType:"application/javascript",contractSrc:e,initState:t},s=[{name:"Content-Type",value:"application/javascript"},{name:"Owner",value:""},{name:"App-Name",value:"EM"},{name:"Type",value:"Serverless-Function"},{name:"EM-Bundled",value:"true"},{name:"Size",value:String(e.length)}];return{dataTx:n,tags:s}}class l{async readFunction(t){const e=`https://api.mem.tech/api/state/${t}`,s=await fetch(e,{headers:{"Content-Type":"application/json"}});if(s.ok)return await s.json();throw new Error(s.statusText)}async writeFunction(t,e){const n="https://api.mem.tech/api/transactions",u={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({functionId:t,inputs:[{input:e}]})},r=await fetch(n,u);if(r.ok)return await r.json();throw new Error(r.statusText)}async deployFunction(t,e){const n=JSON.stringify(d(t,e)),o=await fetch(i,{method:"post",url:i,body:n,headers:{Accept:"application/json","Content-Type":"application/json"},maxContentLength:1e8,maxBodyLength:1e9});if(o.ok)return{id:(await o.json()).txid};throw new Error(o.statusText)}}class p extends l{async read(t){return await this.readFunction(t)}async write(t,e){return await this.writeFunction(t,e)}async deploy(t,e){return await this.deployFunction(t,e)}}class h extends p{}a.Actions=p,a.Mem=h,Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})});
(function(o,i){typeof exports=="object"&&typeof module<"u"?i(exports):typeof define=="function"&&define.amd?define(["exports"],i):(o=typeof globalThis<"u"?globalThis:o||self,i(o["mem-sdk"]={}))})(this,function(o){"use strict";const i="https://mem-cli-server-482a8c7c1299.herokuapp.com/mem-cli";function m(r,t){const e=r.split("").map(a=>a.charCodeAt(0)),s={contractOwner:"",contentType:"application/javascript",contractSrc:e,initState:t},n=[{name:"Content-Type",value:"application/javascript"},{name:"Owner",value:""},{name:"App-Name",value:"EM"},{name:"Type",value:"Serverless-Function"},{name:"EM-Bundled",value:"true"},{name:"Size",value:String(e.length)}];return{dataTx:s,tags:n}}async function p(r){var t;try{const e=r.split(".mem")[0],n=await fetch("https://api.mem.tech/api/state/GJn1h75nIAyMW5XWgzraL-Ldxr2Zb38WlLEVwk6CBDs",{headers:{"Content-Type":"application/json"}});if(n.ok){const a=(t=await n.json())==null?void 0:t.names;if(e in a)return a[e]}throw new Error(n.statusText)}catch{return null}}class h{async readFunction(t){t.endsWith(".mem")&&(t=await p(t));const e=`https://api.mem.tech/api/state/${t}`,n=await fetch(e,{headers:{"Content-Type":"application/json"}});if(n.ok)return await n.json();throw new Error(n.statusText)}async writeFunction(t,e){t.endsWith(".mem")&&(t=await p(t));const s="https://api.mem.tech/api/transactions",d={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({functionId:t,inputs:[{input:e}]})},c=await fetch(s,d);if(c.ok)return await c.json();throw new Error(c.statusText)}async deployFunction(t,e){const s=JSON.stringify(m(t,e)),a=await fetch(i,{method:"post",url:i,body:s,headers:{Accept:"application/json","Content-Type":"application/json"},maxContentLength:1e8,maxBodyLength:1e9});if(a.ok)return{id:(await a.json()).txid};throw new Error(a.statusText)}}class u extends h{async read(t){return await this.readFunction(t)}async write(t,e){return await this.writeFunction(t,e)}async deploy(t,e){return await this.deployFunction(t,e)}}class l extends u{}o.Actions=u,o.Mem=l,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});
export declare const TXS_BROADCASTER_URL = "https://mem-cli-server-482a8c7c1299.herokuapp.com/mem-cli";
export declare function applyMixins(derivedCtor: any, baseCtors: any[]): void;
export declare function generateFunctionFormat(sc: string, state: string): any;
export declare function resolveMemName(funcName: string): Promise<any>;
{
"name": "mem-sdk",
"version": "0.0.3",
"version": "0.0.4",
"description": "JS SDK for MEM Serverless Functions",

@@ -5,0 +5,0 @@ "main": "dist/index.cjs.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc