This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// json | |
const ethers = require('ethers'); | |
const { FormatTypes } = require('ethers/lib/utils'); | |
const iface = new ethers.utils.Interface([ | |
'event MyEvent(address recipient, address asset, uint256 amount)', | |
]); | |
jsonAbi = iface.format(FormatTypes.json); | |
console.log(JSON.stringify(JSON.parse(jsonAbi), null, 2)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const AWS = require('aws-sdk'); | |
AWS.config.update({ region: 'us-east-1' }); | |
const timer = require('timers/promises'); // Only avail in nodejs v16+ | |
var cloudwatchlogs = new AWS.CloudWatchLogs({ apiVersion: '2014-03-28' }); | |
(async function () { | |
let nextToken = null; | |
do { | |
const logGroupsResponse = await cloudwatchlogs | |
.describeLogGroups({ limit: 10, nextToken: nextToken }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stateMachines: | |
RunLambdaEveryXsecond: | |
events: | |
- schedule: | |
rate: rate(1 minute) | |
enabled: false | |
input: | |
counter: 0 | |
name: RunLambdaEveryXsecond | |
definition: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
service: serverless-nodejs-api | |
provider: | |
name: aws | |
runtime: nodejs10.x | |
stage: dev | |
functions: | |
getMsg: | |
handler: handler.api | |
events: | |
- http: GET / |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
module.exports.api = async event => { | |
return { | |
statusCode: 200, | |
body: JSON.stringify( | |
{ | |
message: 'Go Serverless v1.0! Your function executed successfully!' | |
}, | |
null, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Web3 from 'web3' | |
import { generateFirstWallets, mnemonics } from './helpers/wallets' | |
import RootTokenArtifacts from '../contracts/RootToken.json' | |
import ChildTokenArtifacts from '../contracts/ChildToken.json' | |
import RootNftArtifacts from '../contracts/RootNft.json' | |
import ChildNftArtifacts from '../contracts/ChildNft.json' | |
import RootManagerArtifacts from '../contracts/RootManager.json' | |
import ChildManagerArtifacts from '../contracts/ChildManager.json' |