From 7c2b4ae9979b3bb97b9b1e707a04ac4071e06233 Mon Sep 17 00:00:00 2001 From: simke9445 Date: Sun, 3 Mar 2024 00:34:11 +0100 Subject: [PATCH] misc --- .gitignore | 2 ++ package.json | 2 ++ src/composers/variable.ts | 2 +- src/examples/example_eris.ts | 6 +++++- yarn.lock | 15 ++++++++++++++- 5 files changed, 24 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 70e7a6b..a32705c 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,5 @@ yarn-error.log npm-debug.log* yarn-debug.log* yarn-error.log* + +types.d.ts \ No newline at end of file diff --git a/package.json b/package.json index b753221..a2bbecc 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "bot-neutron": "esbuild src/bot.ts --bundle --platform=node --outdir=dist --outbase=src && node ./dist/bot.js ./config.neutron.json", "bot-injective": "esbuild src/bot.ts --bundle --platform=node --outdir=dist --outbase=src && node ./dist/bot.js ./config.injective.json", "bot-nibiru": "esbuild src/bot.ts --bundle --platform=node --outdir=dist --outbase=src && node ./dist/bot.js ./config.nibiru.json", + "generate-dts": "dts-bundle-generator -o types.d.ts src/index.ts", "format": "prettier --write \"src/**/*.{js,ts,tsx}\"", "generate-types": "node --experimental-specifier-resolution=node --loader ts-node/esm ./scripts/generate-types.js warp-protocol", "postinstall": "husky install", @@ -67,6 +68,7 @@ "@types/big.js": "^6.1.6", "@types/jest": "^29.5.1", "@types/lodash": "^4.14.191", + "dts-bundle-generator": "^9.3.1", "esbuild": "^0.14.54", "esbuild-node-externals": "^1.6.0", "husky": "^8.0.2", diff --git a/src/composers/variable.ts b/src/composers/variable.ts index 7ed9619..9b714a9 100644 --- a/src/composers/variable.ts +++ b/src/composers/variable.ts @@ -5,7 +5,7 @@ class StaticVariableComposer { private variable: warp_resolver.StaticVariable; constructor() { - this.variable = { kind: 'string', name: '', value: '', encode: false, init_fn: null, reinitialize: false }; + this.variable = { kind: 'string', name: '', encode: false, init_fn: null, reinitialize: false }; } kind(kind: warp_resolver.VariableKind): StaticVariableComposer { diff --git a/src/examples/example_eris.ts b/src/examples/example_eris.ts index af82781..241ebef 100644 --- a/src/examples/example_eris.ts +++ b/src/examples/example_eris.ts @@ -23,7 +23,11 @@ const nextExecution = variable .static() .kind('uint') .name('next_execution') - .value(ts.date(new Date('2023-04-10T12:30:00.000Z'))) + .onInit({ + uint: { + simple: ts.date(new Date('2023-04-10T12:30:00.000Z')), + }, + }) .onSuccess(fn.uint(uint.expr(uint.simple(ts.days(1)), 'add', uint.env('time')))) .onError(fn.uint(uint.expr(uint.simple(ts.hours(1)), 'add', uint.env('time')))) .compose(); diff --git a/yarn.lock b/yarn.lock index 2db89ea..be52da0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2016,6 +2016,14 @@ dotenv@^16.0.1: resolved "https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz" integrity sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ== +dts-bundle-generator@^9.3.1: + version "9.3.1" + resolved "https://registry.yarnpkg.com/dts-bundle-generator/-/dts-bundle-generator-9.3.1.tgz#dfc2b20b2ceb5afe4b3deed516b997e8782219df" + integrity sha512-1/nMT7LFOkXbrL1ZvLpzrjNbfX090LZ64nLIXVmet557mshFCGP/oTiQiZenafJZ6GsmRQLTYKSlQnkxK8tsTw== + dependencies: + typescript ">=5.0.2" + yargs "^17.6.0" + eastasianwidth@^0.2.0: version "0.2.0" resolved "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz" @@ -4428,6 +4436,11 @@ typeforce@^1.11.5: resolved "https://registry.npmjs.org/typeforce/-/typeforce-1.18.0.tgz" integrity sha512-7uc1O8h1M1g0rArakJdf0uLRSSgFcYexrVoKo+bzJd32gd4gDy2L/Z+8/FjPnU9ydY3pEnVPtr9FyscYY60K1g== +typescript@>=5.0.2: + version "5.3.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.3.3.tgz#b3ce6ba258e72e6305ba66f5c9b452aaee3ffe37" + integrity sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw== + typescript@^4.8.2: version "4.9.3" resolved "https://registry.npmjs.org/typescript/-/typescript-4.9.3.tgz" @@ -4586,7 +4599,7 @@ yargs-parser@^21.0.1, yargs-parser@^21.1.1: resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35" integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw== -yargs@^17.3.1: +yargs@^17.3.1, yargs@^17.6.0: version "17.7.2" resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.7.2.tgz#991df39aca675a192b816e1e0363f9d75d2aa269" integrity sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==