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

@onflow/sdk

Package Overview
Dependencies
Maintainers
4
Versions
165
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@onflow/sdk - npm Package Compare versions

Comparing version 0.0.8 to 0.0.9

readme.md

2

dist/sdk.js

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

var e=require("@qvvg/templar"),t=require("@onflow/interaction");require("@onflow/bytes");var r=require("@onflow/assigns"),n=require("@onflow/send"),o=require("@onflow/decode"),i=require("@qvvg/mario"),p=[],u=function(e){return function(t){return null==t?e:t}},s=i.pipe,a=i.pipe([r.update("code",function(e,t){return"function"==typeof e?e(r.get(t,"params",{})):e})]);exports.send=n.send,exports.decode=o.decode,exports.decodeResponse=o.decodeResponse,exports.isOk=i.isOk,exports.isNope=i.isNope,exports.getValue=i.getValue,exports.getReason=i.getReason,exports.getError=i.getError,exports.log=i.log,exports.pipe=i.pipe,exports.build=function(e){return i.pipe(t.interaction(),e)},exports.script=function(){for(var n=[],o=arguments.length;o--;)n[o]=arguments[o];return i.pipe([t.makeScript,r.put("code",e.t7l.apply(void 0,n))])},exports.transaction=function(){for(var n=[],o=arguments.length;o--;)n[o]=arguments[o];return i.pipe([t.makeTransaction,r.put("code",e.t7l.apply(void 0,n)),r.update("computeLimit",u(10)),r.update("scriptAccounts",u(p)),r.update("nonce",u(Date.now()))])},exports.getTransaction=function(e){return i.pipe([t.makeGetTransaction,r.put("hash",e)])},exports.getAccount=function(e){return i.pipe([t.makeGetAccount,r.put("address",e)])},exports.getEvents=function(e,n,o){return i.pipe([t.makeGetEvents,r.put("eventType",e),r.put("startBlock",n),r.put("endBlock",o)])},exports.getLatestBlock=function(e){return void 0===e&&(e=!1),i.pipe([t.makeGetLatestBlock,r.put("isSealed",e)])},exports.ping=function(){return i.pipe([t.makePing])},exports.params=function(e){return void 0===e&&(e=[]),i.pipe([r.put("params",(t=e,void 0===t&&(t=[]),t.reduce(function(e,t){var r;return Object.assign({},e,((r={})[t.key]=t.value,r))},{})))]);var t},exports.param=function(e,t,r){return void 0===r&&(r=null),{key:e,value:t}},exports.authorizations=function(e){return void 0===e&&(e=[]),i.pipe([r.put("authorizations",e)])},exports.authorization=function(e,t){return{acct:e,signFn:t}},exports.payer=function(e){return i.pipe([r.put("payerAuthorization",e)])},exports.nonce=function(e){return i.pipe([r.put("nonce",e)])},exports.referenceBlockHash=function(e){return i.pipe([r.put("referenceBlockHash",e)])},exports.computeLimit=function(e){return i.pipe([r.put("computeLimit",e)])},exports.resolve=s,exports.resolveParams=a,exports.resolveSignatures=function(e){try{if(!t.isTransaction(e))return Promise.resolve(i.Ok(e));if(null==r.get(e,"authorizations"))return Promise.resolve(i.Nope(e,"Transactions require at least one authoriztion"));if(r.get(e,"authorizations").length<1)return Promise.resolve(i.Nope(e,"Transactions require at least one authoriztion"));var n=e.authorizations.map(function(t){return new Promise(function(r){try{return Promise.resolve(t.signFn(e.payload)).then(function(e){r(function(e,r){return{acct:t.acct,signature:r}}(0,e))})}catch(e){return Promise.reject(e)}})});return Promise.resolve(Promise.all(n)).then(function(t){return e.signatures=t,i.Ok(e)})}catch(e){return Promise.reject(e)}};
var e=require("@onflow/send"),t=require("@onflow/decode"),r=require("@qvvg/templar");require("@onflow/bytes");var n=require("@onflow/interaction"),o=n.pipe,i=[];function u(e){return function(t){return null==t?e:t}}var p=n.pipe([n.update("ix.code",function(e,t){return"function"==typeof e?e(n.get(t,"ix.params",{})):e})]);exports.send=e.send,exports.decode=t.decode,exports.decodeResponse=t.decodeResponse,exports.isOk=n.isOk,exports.isNope=n.isNope,exports.why=n.why,exports.pipe=n.pipe,exports.build=function(e){return void 0===e&&(e=[]),n.pipe(n.interaction(),e)},exports.resolve=o,exports.authorizations=function(e){return void 0===e&&(e=[]),n.pipe([n.put("tx.authorizations",e)])},exports.authorization=function(e,t){return{acct:e,signFn:t}},exports.getAccount=function(e){return pipe([n.makeGetAccount,n.put("ga.acct",e)])},exports.getEvents=function(e,t,r){return n.pipe([n.makeGetEvents,n.put("ge.eventType",e),n.put("bounds.start",t),n.put("bounds.end",r)])},exports.getLatestBlock=function(e){return void 0===e&&(e=!1),n.pipe([n.makeGetLatestBlock,n.put("glb.isSealed",e)])},exports.getTransaction=function(e){return n.pipe([n.makeGetTransaction,n.put("gt.txId",e)])},exports.limit=function(e){return n.pipe([n.put("tx.limit",e)])},exports.nonce=function(e){return n.pipe([n.put("tx.nonce",e)])},exports.params=function(e){return void 0===e&&(e=[]),n.pipe([n.put("ix.params",(t=e,void 0===t&&(t=[]),t.reduce(function(e,t){var r;return Object.assign({},e,((r={})[t.key]=t.value,r))},{})))]);var t},exports.param=function(e,t,r){return void 0===r&&(r=null),{key:e,value:t}},exports.payer=function(e){return n.pipe([n.put("tx.payer",e)])},exports.ping=function(){return n.pipe([n.makePing])},exports.ref=function(e){return n.pipe([n.put("tx.ref",e)])},exports.script=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return n.pipe([n.makeScript,n.put("ix.code",r.t7l.apply(void 0,e))])},exports.transaction=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return n.pipe([n.makeTransaction,n.put("ix.code",r.t7l.apply(void 0,e)),n.update("tx.limit",u(10)),n.update("tx.authorizations",u(i)),n.update("tx.nonce",u(Date.now()))])},exports.resolveAuthorizations=function(e){try{if(!n.isTransaction(e))return Promise.resolve(n.Ok(is));if(!function(e){var t=n.get(e,"tx.authorizations");return null!=t&&Array.isArray(t)&&t.length>=1}(e))return Promise.resolve(n.Nope(e,"Transactions require at least one authoriztion"));var t=n.get(e,"tx.authorizations",[]).map(function(t){try{function r(){var r=t.acct;return Promise.resolve(t.signFn(e.payload)).then(function(e){return{acct:r,signature:e}})}var n=function(){if("function"==typeof t)return Promise.resolve(t()).then(function(e){t=e})}();return Promise.resolve(n&&n.then?n.then(r):r())}catch(e){return Promise.reject(e)}});return Promise.resolve(Promise.all(t)).then(function(t){return e.authz=t,n.Ok(e)})}catch(e){return Promise.reject(e)}},exports.resolveParams=p;
//# sourceMappingURL=sdk.js.map

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

import{t7l as n}from"@qvvg/templar";import{interaction as r,makeScript as e,makeTransaction as t,makeGetTransaction as o,makeGetAccount as i,makeGetEvents as u,makeGetLatestBlock as c,makePing as a,isTransaction as s}from"@onflow/interaction";import"@onflow/bytes";import{put as f,update as l,get as m}from"@onflow/assigns";export{send}from"@onflow/send";export{decode,decodeResponse}from"@onflow/decode";import{pipe as p,Ok as v,Nope as d}from"@qvvg/mario";export{isOk,isNope,getValue,getReason,getError,log,pipe}from"@qvvg/mario";var h=function(n){return p(r(),n)},g=function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];return p([e,f("code",n.apply(void 0,r))])},y=[],P=function(n){return function(r){return null==r?n:r}},w=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];return p([t,f("code",n.apply(void 0,r)),l("computeLimit",P(10)),l("scriptAccounts",P(y)),l("nonce",P(Date.now()))])},z=function(n){return p([o,f("hash",n)])},k=function(n){return p([i,f("address",n)])},q=function(n,r,e){return p([u,f("eventType",n),f("startBlock",r),f("endBlock",e)])},x=function(n){return void 0===n&&(n=!1),p([c,f("isSealed",n)])},j=function(){return p([a])},B=function(n){return void 0===n&&(n=[]),p([f("params",(r=n,void 0===r&&(r=[]),r.reduce(function(n,r){var e;return Object.assign({},n,((e={})[r.key]=r.value,e))},{})))]);var r},T=function(n,r,e){return void 0===e&&(e=null),{key:n,value:r}},b=function(n){return void 0===n&&(n=[]),p([f("authorizations",n)])},A=function(n,r){return{acct:n,signFn:r}},F=function(n){return p([f("payerAuthorization",n)])},L=function(n){return p([f("nonce",n)])},O=function(n){return p([f("referenceBlockHash",n)])},R=function(n){return p([f("computeLimit",n)])},D=p,E=p([l("code",function(n,r){return"function"==typeof n?n(m(r,"params",{})):n})]),H=function(n){try{if(!s(n))return Promise.resolve(v(n));if(null==m(n,"authorizations"))return Promise.resolve(d(n,"Transactions require at least one authoriztion"));if(m(n,"authorizations").length<1)return Promise.resolve(d(n,"Transactions require at least one authoriztion"));var r=n.authorizations.map(function(r){return new Promise(function(e){try{return Promise.resolve(r.signFn(n.payload)).then(function(n){e(function(n,e){return{acct:r.acct,signature:e}}(0,n))})}catch(n){return Promise.reject(n)}})});return Promise.resolve(Promise.all(r)).then(function(r){return n.signatures=r,v(n)})}catch(n){return Promise.reject(n)}};export{h as build,g as script,w as transaction,z as getTransaction,k as getAccount,q as getEvents,x as getLatestBlock,j as ping,B as params,T as param,b as authorizations,A as authorization,F as payer,L as nonce,O as referenceBlockHash,R as computeLimit,D as resolve,E as resolveParams,H as resolveSignatures};
export{send}from"@onflow/send";export{decode,decodeResponse}from"@onflow/decode";import{t7l as n}from"@qvvg/templar";import"@onflow/bytes";import{pipe as r,interaction as t,put as e,makeGetAccount as o,makeGetEvents as i,makeGetLatestBlock as u,makeGetTransaction as c,makePing as a,makeScript as f,update as s,makeTransaction as l,Ok as v,Nope as p,isTransaction as d,get as m}from"@onflow/interaction";export{isOk,isNope,why,pipe}from"@onflow/interaction";function x(n){return void 0===n&&(n=[]),r(t(),n)}var h=r;function y(n){return void 0===n&&(n=[]),r([e("tx.authorizations",n)])}function g(n,r){return{acct:n,signFn:r}}function P(n){return pipe([o,e("ga.acct",n)])}function w(n,t,o){return r([i,e("ge.eventType",n),e("bounds.start",t),e("bounds.end",o)])}function z(n){return void 0===n&&(n=!1),r([u,e("glb.isSealed",n)])}function b(n){return r([c,e("gt.txId",n)])}function j(n){return r([e("tx.limit",n)])}function k(n){return r([e("tx.nonce",n)])}function q(n){return void 0===n&&(n=[]),r([e("ix.params",(t=n,void 0===t&&(t=[]),t.reduce(function(n,r){var t;return Object.assign({},n,((t={})[r.key]=r.value,t))},{})))]);var t}function A(n,r,t){return void 0===t&&(t=null),{key:n,value:r}}function F(n){return r([e("tx.payer",n)])}function O(){return r([a])}function T(n){return r([e("tx.ref",n)])}function D(){for(var t=[],o=arguments.length;o--;)t[o]=arguments[o];return r([f,e("ix.code",n.apply(void 0,t))])}var I=10,N=[];function R(n){return function(r){return null==r?n:r}}function S(){for(var t=[],o=arguments.length;o--;)t[o]=arguments[o];return r([l,e("ix.code",n.apply(void 0,t)),s("tx.limit",R(I)),s("tx.authorizations",R(N)),s("tx.nonce",R(Date.now()))])}var B=function(n){try{if(!d(n))return Promise.resolve(v(is));if(!function(n){var r=m(n,"tx.authorizations");return null!=r&&Array.isArray(r)&&r.length>=1}(n))return Promise.resolve(p(n,C));var r=m(n,"tx.authorizations",[]).map(function(r){try{function t(){var t=r.acct;return Promise.resolve(r.signFn(n.payload)).then(function(n){return{acct:t,signature:n}})}var e=function(){if("function"==typeof r)return Promise.resolve(r()).then(function(n){r=n})}();return Promise.resolve(e&&e.then?e.then(t):t())}catch(n){return Promise.reject(n)}});return Promise.resolve(Promise.all(r)).then(function(r){return n.authz=r,v(n)})}catch(n){return Promise.reject(n)}},C="Transactions require at least one authoriztion",E=r([s("ix.code",function(n,r){return"function"==typeof n?n(m(r,"ix.params",{})):n})]);export{x as build,h as resolve,y as authorizations,g as authorization,P as getAccount,w as getEvents,z as getLatestBlock,b as getTransaction,j as limit,k as nonce,q as params,A as param,F as payer,O as ping,T as ref,D as script,S as transaction,B as resolveAuthorizations,E as resolveParams};
//# sourceMappingURL=sdk.module.js.map

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

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@qvvg/templar"),require("@onflow/interaction"),require("@onflow/bytes"),require("@onflow/assigns"),require("@onflow/send"),require("@onflow/decode"),require("@qvvg/mario")):"function"==typeof define&&define.amd?define(["exports","@qvvg/templar","@onflow/interaction","@onflow/bytes","@onflow/assigns","@onflow/send","@onflow/decode","@qvvg/mario"],t):t(e.sdk={},e.templar,e.interaction,0,e.assigns,e.send,e.decode,e.mario)}(this,function(e,t,n,r,o,i,u,a){var s=[],p=function(e){return function(t){return null==t?e:t}},c=a.pipe,f=a.pipe([o.update("code",function(e,t){return"function"==typeof e?e(o.get(t,"params",{})):e})]);e.send=i.send,e.decode=u.decode,e.decodeResponse=u.decodeResponse,e.isOk=a.isOk,e.isNope=a.isNope,e.getValue=a.getValue,e.getReason=a.getReason,e.getError=a.getError,e.log=a.log,e.pipe=a.pipe,e.build=function(e){return a.pipe(n.interaction(),e)},e.script=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return a.pipe([n.makeScript,o.put("code",t.t7l.apply(void 0,e))])},e.transaction=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return a.pipe([n.makeTransaction,o.put("code",t.t7l.apply(void 0,e)),o.update("computeLimit",p(10)),o.update("scriptAccounts",p(s)),o.update("nonce",p(Date.now()))])},e.getTransaction=function(e){return a.pipe([n.makeGetTransaction,o.put("hash",e)])},e.getAccount=function(e){return a.pipe([n.makeGetAccount,o.put("address",e)])},e.getEvents=function(e,t,r){return a.pipe([n.makeGetEvents,o.put("eventType",e),o.put("startBlock",t),o.put("endBlock",r)])},e.getLatestBlock=function(e){return void 0===e&&(e=!1),a.pipe([n.makeGetLatestBlock,o.put("isSealed",e)])},e.ping=function(){return a.pipe([n.makePing])},e.params=function(e){return void 0===e&&(e=[]),a.pipe([o.put("params",(t=e,void 0===t&&(t=[]),t.reduce(function(e,t){var n;return Object.assign({},e,((n={})[t.key]=t.value,n))},{})))]);var t},e.param=function(e,t,n){return void 0===n&&(n=null),{key:e,value:t}},e.authorizations=function(e){return void 0===e&&(e=[]),a.pipe([o.put("authorizations",e)])},e.authorization=function(e,t){return{acct:e,signFn:t}},e.payer=function(e){return a.pipe([o.put("payerAuthorization",e)])},e.nonce=function(e){return a.pipe([o.put("nonce",e)])},e.referenceBlockHash=function(e){return a.pipe([o.put("referenceBlockHash",e)])},e.computeLimit=function(e){return a.pipe([o.put("computeLimit",e)])},e.resolve=c,e.resolveParams=f,e.resolveSignatures=function(e){try{if(!n.isTransaction(e))return Promise.resolve(a.Ok(e));if(null==o.get(e,"authorizations"))return Promise.resolve(a.Nope(e,"Transactions require at least one authoriztion"));if(o.get(e,"authorizations").length<1)return Promise.resolve(a.Nope(e,"Transactions require at least one authoriztion"));var t=e.authorizations.map(function(t){return new Promise(function(n){try{return Promise.resolve(t.signFn(e.payload)).then(function(e){n(function(e,n){return{acct:t.acct,signature:n}}(0,e))})}catch(e){return Promise.reject(e)}})});return Promise.resolve(Promise.all(t)).then(function(t){return e.signatures=t,a.Ok(e)})}catch(e){return Promise.reject(e)}}});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@onflow/send"),require("@onflow/decode"),require("@qvvg/templar"),require("@onflow/bytes"),require("@onflow/interaction")):"function"==typeof define&&define.amd?define(["exports","@onflow/send","@onflow/decode","@qvvg/templar","@onflow/bytes","@onflow/interaction"],t):t(e.sdk={},e.send,e.decode,e.templar,0,e.interaction)}(this,function(e,t,n,r,i,o){var u=o.pipe,a=[];function p(e){return function(t){return null==t?e:t}}var c=o.pipe([o.update("ix.code",function(e,t){return"function"==typeof e?e(o.get(t,"ix.params",{})):e})]);e.send=t.send,e.decode=n.decode,e.decodeResponse=n.decodeResponse,e.isOk=o.isOk,e.isNope=o.isNope,e.why=o.why,e.pipe=o.pipe,e.build=function(e){return void 0===e&&(e=[]),o.pipe(o.interaction(),e)},e.resolve=u,e.authorizations=function(e){return void 0===e&&(e=[]),o.pipe([o.put("tx.authorizations",e)])},e.authorization=function(e,t){return{acct:e,signFn:t}},e.getAccount=function(e){return pipe([o.makeGetAccount,o.put("ga.acct",e)])},e.getEvents=function(e,t,n){return o.pipe([o.makeGetEvents,o.put("ge.eventType",e),o.put("bounds.start",t),o.put("bounds.end",n)])},e.getLatestBlock=function(e){return void 0===e&&(e=!1),o.pipe([o.makeGetLatestBlock,o.put("glb.isSealed",e)])},e.getTransaction=function(e){return o.pipe([o.makeGetTransaction,o.put("gt.txId",e)])},e.limit=function(e){return o.pipe([o.put("tx.limit",e)])},e.nonce=function(e){return o.pipe([o.put("tx.nonce",e)])},e.params=function(e){return void 0===e&&(e=[]),o.pipe([o.put("ix.params",(t=e,void 0===t&&(t=[]),t.reduce(function(e,t){var n;return Object.assign({},e,((n={})[t.key]=t.value,n))},{})))]);var t},e.param=function(e,t,n){return void 0===n&&(n=null),{key:e,value:t}},e.payer=function(e){return o.pipe([o.put("tx.payer",e)])},e.ping=function(){return o.pipe([o.makePing])},e.ref=function(e){return o.pipe([o.put("tx.ref",e)])},e.script=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return o.pipe([o.makeScript,o.put("ix.code",r.t7l.apply(void 0,e))])},e.transaction=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return o.pipe([o.makeTransaction,o.put("ix.code",r.t7l.apply(void 0,e)),o.update("tx.limit",p(10)),o.update("tx.authorizations",p(a)),o.update("tx.nonce",p(Date.now()))])},e.resolveAuthorizations=function(e){try{if(!o.isTransaction(e))return Promise.resolve(o.Ok(is));if(!function(e){var t=o.get(e,"tx.authorizations");return null!=t&&Array.isArray(t)&&t.length>=1}(e))return Promise.resolve(o.Nope(e,"Transactions require at least one authoriztion"));var t=o.get(e,"tx.authorizations",[]).map(function(t){try{function n(){var n=t.acct;return Promise.resolve(t.signFn(e.payload)).then(function(e){return{acct:n,signature:e}})}var r=function(){if("function"==typeof t)return Promise.resolve(t()).then(function(e){t=e})}();return Promise.resolve(r&&r.then?r.then(n):n())}catch(e){return Promise.reject(e)}});return Promise.resolve(Promise.all(t)).then(function(t){return e.authz=t,o.Ok(e)})}catch(e){return Promise.reject(e)}},e.resolveParams=c});
//# sourceMappingURL=sdk.umd.js.map
{
"name": "@onflow/sdk",
"version": "0.0.8",
"version": "0.0.9",
"description": "Flow SDK",

@@ -37,10 +37,8 @@ "license": "Apache-2.0",

"dependencies": {
"@onflow/assigns": "0.0.4",
"@onflow/bytes": "0.0.1",
"@onflow/decode": "0.0.1",
"@onflow/interaction": "0.0.2",
"@onflow/interaction": "0.0.3",
"@onflow/send": "0.0.1",
"@qvvg/mario": "1.3.0",
"@qvvg/templar": "0.0.0"
}
}

@@ -1,11 +0,9 @@

import {pipe} from "@qvvg/mario"
import {put} from "@onflow/assigns"
import {pipe, put} from "@onflow/interaction"
export const authorizations = (ax = []) =>
pipe([
put("authorizations", ax)
])
export function authorizations(ax = []) {
return pipe([put("tx.authorizations", ax)])
}
export const authorization = (acct, signFn) => {
export function authorization(acct, signFn) {
return {acct, signFn}
}

@@ -1,6 +0,5 @@

import {pipe} from "@qvvg/mario"
import {makeGetAccount} from "@onflow/interaction"
import {put} from "@onflow/assigns"
import {pipt, put, makeGetAccount} from "@onflow/interaction"
export const getAccount = address =>
pipe([makeGetAccount, put("address", address)])
export function getAccount(acct) {
return pipe([makeGetAccount, put("ga.acct", acct)])
}

@@ -1,11 +0,10 @@

import {pipe} from "@qvvg/mario"
import {makeGetEvents} from "@onflow/interaction"
import {put} from "@onflow/assigns"
import {pipe, put, makeGetEvents} from "@onflow/interaction"
export const getEvents = (eventType, startBlock, endBlock) =>
pipe([
export function getEvents(eventType, start, end) {
return pipe([
makeGetEvents,
put("eventType", eventType),
put("startBlock", startBlock),
put("endBlock", endBlock),
put("ge.eventType", eventType),
put("bounds.start", start),
put("bounds.end", end),
])
}

@@ -1,6 +0,5 @@

import {pipe} from "@qvvg/mario"
import {makeGetLatestBlock} from "@onflow/interaction"
import {put} from "@onflow/assigns"
import {pipe, put, makeGetLatestBlock} from "@onflow/interaction"
export const getLatestBlock = (isSealed = false) =>
pipe([makeGetLatestBlock, put("isSealed", isSealed)])
export function getLatestBlock(isSealed = false) {
return pipe([makeGetLatestBlock, put("glb.isSealed", isSealed)])
}

@@ -1,6 +0,5 @@

import {pipe} from "@qvvg/mario"
import {makeGetTransaction} from "@onflow/interaction"
import {put} from "@onflow/assigns"
import {pipe, put, makeGetTransaction} from "@onflow/interaction"
export const getTransaction = txHash =>
pipe([makeGetTransaction, put("hash", txHash)])
export function getTransaction(txId) {
return pipe([makeGetTransaction, put("gt.txId", txId)])
}

@@ -1,4 +0,5 @@

import {pipe} from "@qvvg/mario"
import {interaction} from "@onflow/interaction"
import {pipe, interaction} from "@onflow/interaction"
export const build = fns => pipe(interaction(), fns)
export function build(fns = []) {
return pipe(interaction(), fns)
}

@@ -1,4 +0,5 @@

import {pipe} from "@qvvg/mario"
import {put} from "@onflow/assigns"
import {pipe, put} from "@onflow/interaction"
export const nonce = nonce => pipe([put("nonce", nonce)])
export function nonce(nonce) {
return pipe([put("tx.nonce", nonce)])
}

@@ -1,14 +0,13 @@

import {pipe} from "@qvvg/mario"
import {put} from "@onflow/assigns"
import {pipe, put} from "@onflow/interaction"
const toMap = (kv = []) =>
kv.reduce((acc, d) => ({...acc, [d.key]: d.value}), {})
function toMap(kv = []) {
return kv.reduce((acc, d) => ({...acc, [d.key]: d.value}), {})
}
export const params = (px = []) =>
pipe([
put("params", toMap(px))
])
export function params(px = []) {
return pipe([put("ix.params", toMap(px))])
}
export const param = (key, value, _type = null) => {
export function param(key, value, _type = null) {
return {key, value}
}

@@ -1,7 +0,5 @@

import {pipe} from "@qvvg/mario"
import {put} from "@onflow/assigns"
import {pipe, put} from "@onflow/interaction"
export const payer = authz =>
pipe([
put("payerAuthorization", authz)
])
export function payer(authz) {
return pipe([put("tx.payer", authz)])
}

@@ -1,4 +0,5 @@

import {pipe} from "@qvvg/mario"
import {makePing} from "@onflow/interaction"
import {pipe, makePing} from "@onflow/interaction"
export const ping = () => pipe([makePing])
export function ping() {
return pipe([makePing])
}

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

import {pipe} from "@qvvg/mario"
import {pipe, put, makeScript} from "@onflow/interaction"
import {t7l} from "@qvvg/templar"
import {makeScript} from "@onflow/interaction"
import {put} from "@onflow/assigns"
export const script = (...args) => pipe([makeScript, put("code", t7l(...args))])
export function script(...args) {
return pipe([makeScript, put("ix.code", t7l(...args))])
}

@@ -1,5 +0,3 @@

import {pipe} from "@qvvg/mario"
import {pipe, put, update, makeTransaction} from "@onflow/interaction"
import {t7l} from "@qvvg/templar"
import {makeTransaction} from "@onflow/interaction"
import {put, update} from "@onflow/assigns"

@@ -11,13 +9,20 @@ const DEFAULT_COMPUTE_LIMIT = 10

// the way the current emulator works
const nonce = () => Date.now()
function nonce() {
return Date.now()
}
const hammer = fallback => value => (value == null ? fallback : value)
function hammer(fallback) {
return function(value) {
return value == null ? fallback : value
}
}
export const transaction = (...args) =>
pipe([
export function transaction(...args) {
return pipe([
makeTransaction,
put("code", t7l(...args)),
update("computeLimit", hammer(DEFAULT_COMPUTE_LIMIT)),
update("scriptAccounts", hammer(DEFAULT_SCRIPT_ACCOUNTS)),
update("nonce", hammer(nonce())),
put("ix.code", t7l(...args)),
update("tx.limit", hammer(DEFAULT_COMPUTE_LIMIT)),
update("tx.authorizations", hammer(DEFAULT_SCRIPT_ACCOUNTS)),
update("tx.nonce", hammer(nonce())),
])
}

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

import {pipe} from "@qvvg/mario"
import {pipe} from "@onflow/interaction"
export const resolve = pipe

@@ -1,8 +0,11 @@

import {pipe} from "@qvvg/mario"
import {get, update} from "@onflow/assigns"
import {pipe, get, update} from "@onflow/interaction"
function isFn(v) {
return typeof v === "function"
}
export const resolveParams = pipe([
update("code", (code, ix) => {
return typeof code === "function" ? code(get(ix, "params", {})) : code
update("ix.code", (code, ix) => {
return isFn(code) ? code(get(ix, "ix.params", {})) : code
}),
])

@@ -0,31 +1,27 @@

// Base
export {build} from "./build"
export {script} from "./build/script"
export {transaction} from "./build/transaction"
export {getTransaction} from "./build/get-transaction"
export {resolve} from "./resolve"
export {send} from "@onflow/send"
export {decode, decodeResponse} from "@onflow/decode"
// Utils
export {isOk, isNope, why, pipe} from "@onflow/interaction"
// builders
export {authorizations, authorization} from "./build/authorizations"
export {getAccount} from "./build/get-account"
export {getEvents} from "./build/get-events"
export {getLatestBlock} from "./build/get-latest-block"
export {ping} from "./build/ping"
export {getTransaction} from "./build/get-transaction"
export {limit} from "./build/limit"
export {nonce} from "./build/nonce"
export {params, param} from "./build/params"
export {authorizations, authorization} from "./build/authorizations"
export {payer} from "./build/payer"
export {nonce} from "./build/nonce"
export {referenceBlockHash} from "./build/reference-block-hash"
export {computeLimit} from "./build/compute-limit"
export {ping} from "./build/ping"
export {ref} from "./build/ref"
export {script} from "./build/script"
export {transaction} from "./build/transaction"
export {resolve} from "./resolve"
// resolvers
export {resolveAuthorizations} from "./resolve/resolve-authorizations"
export {resolveParams} from "./resolve/resolve-params"
export {resolveSignatures} from "./resolve/resolve-signatures"
export {send} from "@onflow/send"
export {decode, decodeResponse} from "@onflow/decode"
export {
isOk,
isNope,
getValue,
getReason,
getError,
log,
pipe,
} from "@qvvg/mario"

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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