UNPKG

@mavrykdynamics/taquito

Version:

High level functionality that builds upon the other packages in the Mavryk Typescript Library Suite.

72 lines (71 loc) 1.92 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MANAGER_LAMBDA = void 0; const setDelegate = (key) => { return [ { prim: 'DROP' }, { prim: 'NIL', args: [{ prim: 'operation' }] }, { prim: 'PUSH', args: [{ prim: 'key_hash' }, { string: key }], }, { prim: 'SOME' }, { prim: 'SET_DELEGATE' }, { prim: 'CONS' }, ]; }; const transferImplicit = (key, mumav) => { return [ { prim: 'DROP' }, { prim: 'NIL', args: [{ prim: 'operation' }] }, { prim: 'PUSH', args: [{ prim: 'key_hash' }, { string: key }], }, { prim: 'IMPLICIT_ACCOUNT' }, { prim: 'PUSH', args: [{ prim: 'mumav' }, { int: `${mumav}` }], }, { prim: 'UNIT' }, { prim: 'TRANSFER_TOKENS' }, { prim: 'CONS' }, ]; }; const removeDelegate = () => { return [ { prim: 'DROP' }, { prim: 'NIL', args: [{ prim: 'operation' }] }, { prim: 'NONE', args: [{ prim: 'key_hash' }] }, { prim: 'SET_DELEGATE' }, { prim: 'CONS' }, ]; }; const transferToContract = (key, amount) => { return [ { prim: 'DROP' }, { prim: 'NIL', args: [{ prim: 'operation' }] }, { prim: 'PUSH', args: [{ prim: 'address' }, { string: key }], }, { prim: 'CONTRACT', args: [{ prim: 'unit' }] }, { prim: 'IF_NONE', args: [[{ prim: 'UNIT' }, { prim: 'FAILWITH' }], []], }, { prim: 'PUSH', args: [{ prim: 'mumav' }, { int: `${amount}` }], }, { prim: 'UNIT' }, { prim: 'TRANSFER_TOKENS' }, { prim: 'CONS' }, ]; }; exports.MANAGER_LAMBDA = { setDelegate, removeDelegate, transferImplicit, transferToContract, };