@arken/node 1.5.1 → 1.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.rush/temp/shrinkwrap-deps.json +39 -82
- package/build/api.js.map +1 -0
- package/build/array.js.map +1 -0
- package/build/browser.js.map +1 -0
- package/build/codebase.js.map +1 -0
- package/build/config.js.map +1 -0
- package/build/db.d.ts +41 -0
- package/build/db.js +234 -0
- package/build/db.js.map +1 -0
- package/build/{util/decoder.js → decoder.js} +3 -3
- package/build/decoder.js.map +1 -0
- package/build/format.js.map +1 -0
- package/build/guid.js.map +1 -0
- package/build/index.d.ts +70 -18
- package/build/index.js +216 -18
- package/build/index.js.map +1 -1
- package/build/json.js.map +1 -0
- package/build/legacy/data/items.js +1 -1
- package/build/legacy/data/items.js.map +1 -1
- package/build/log.d.ts +5 -0
- package/build/log.js +28 -0
- package/build/log.js.map +1 -0
- package/build/math.js.map +1 -0
- package/build/{util/merkle.js → merkle.js} +1 -1
- package/build/merkle.js.map +1 -0
- package/build/{util/mongo.js → mongo.js} +1 -1
- package/build/mongo.js.map +1 -0
- package/build/number.js.map +1 -0
- package/build/object.js.map +1 -0
- package/build/otp.js.map +1 -0
- package/build/package.json +3 -3
- package/build/physics.js.map +1 -0
- package/build/{util/process.js → process.js} +1 -1
- package/build/process.js.map +1 -0
- package/build/rpc.js.map +1 -0
- package/build/schema.d.ts +42 -51
- package/build/seer.js.map +1 -0
- package/build/string.js.map +1 -0
- package/build/text.js.map +1 -0
- package/build/time/date.js.map +1 -0
- package/build/time/fancyTimeFormat.js.map +1 -0
- package/build/time/index.js.map +1 -0
- package/build/time/now.js.map +1 -0
- package/build/trpc/socketLink.d.ts +62 -0
- package/build/trpc/socketLink.js +261 -0
- package/build/trpc/socketLink.js.map +1 -0
- package/build/trpc/socketServer.d.ts +15 -0
- package/build/trpc/socketServer.js +47 -0
- package/build/trpc/socketServer.js.map +1 -0
- package/build/tsconfig.tsbuildinfo +1 -1
- package/build/util.d.ts +1 -0
- package/build/util.js +2 -0
- package/build/util.js.map +1 -0
- package/build/web3/httpProvider.js.map +1 -0
- package/build/{util/web3.js → web3.js} +1 -1
- package/build/web3.js.map +1 -0
- package/build/{util/websocket.js → websocket.js} +1 -1
- package/build/websocket.js.map +1 -0
- package/build/zk.js.map +1 -0
- package/build/{util/zod.d.ts → zod.d.ts} +2 -0
- package/build/{util/zod.js → zod.js} +1 -0
- package/build/zod.js.map +1 -0
- package/db.ts +76 -1
- package/{util/decoder.ts → decoder.ts} +3 -3
- package/index.ts +306 -18
- package/legacy/data/items.ts +1 -1
- package/log.ts +51 -0
- package/{util/merkle.ts → merkle.ts} +3 -1
- package/{util/mongo.ts → mongo.ts} +1 -1
- package/package.json +3 -3
- package/{util/process.ts → process.ts} +1 -1
- package/trpc/socketLink.ts +2 -2
- package/trpc/socketServer.ts +1 -1
- package/tsconfig.json +35 -6
- package/util.ts +1 -0
- package/{util/web3.ts → web3.ts} +2 -1
- package/{util/websocket.ts → websocket.ts} +1 -1
- package/{util/zod.ts → zod.ts} +2 -0
- package/build/modules/area/area.models.d.ts +0 -6
- package/build/modules/area/area.models.js +0 -11
- package/build/modules/area/area.models.js.map +0 -1
- package/build/modules/area/area.router.d.ts +0 -274
- package/build/modules/area/area.router.js +0 -59
- package/build/modules/area/area.router.js.map +0 -1
- package/build/modules/area/area.schema.d.ts +0 -245
- package/build/modules/area/area.schema.js +0 -13
- package/build/modules/area/area.schema.js.map +0 -1
- package/build/modules/area/area.service.d.ts +0 -12
- package/build/modules/area/area.service.js +0 -95
- package/build/modules/area/area.service.js.map +0 -1
- package/build/modules/area/area.types.d.ts +0 -20
- package/build/modules/area/area.types.js +0 -2
- package/build/modules/area/area.types.js.map +0 -1
- package/build/modules/area/index.d.ts +0 -5
- package/build/modules/area/index.js +0 -6
- package/build/modules/area/index.js.map +0 -1
- package/build/modules/asset/asset.models.d.ts +0 -5
- package/build/modules/asset/asset.models.js +0 -44
- package/build/modules/asset/asset.models.js.map +0 -1
- package/build/modules/asset/asset.router.d.ts +0 -189
- package/build/modules/asset/asset.router.js +0 -41
- package/build/modules/asset/asset.router.js.map +0 -1
- package/build/modules/asset/asset.schema.d.ts +0 -207
- package/build/modules/asset/asset.schema.js +0 -19
- package/build/modules/asset/asset.schema.js.map +0 -1
- package/build/modules/asset/asset.service.d.ts +0 -9
- package/build/modules/asset/asset.service.js +0 -68
- package/build/modules/asset/asset.service.js.map +0 -1
- package/build/modules/asset/asset.types.d.ts +0 -17
- package/build/modules/asset/asset.types.js +0 -2
- package/build/modules/asset/asset.types.js.map +0 -1
- package/build/modules/asset/index.d.ts +0 -5
- package/build/modules/asset/index.js +0 -6
- package/build/modules/asset/index.js.map +0 -1
- package/build/modules/chain/chain.models.d.ts +0 -6
- package/build/modules/chain/chain.models.js +0 -42
- package/build/modules/chain/chain.models.js.map +0 -1
- package/build/modules/chain/chain.router.d.ts +0 -364
- package/build/modules/chain/chain.router.js +0 -84
- package/build/modules/chain/chain.router.js.map +0 -1
- package/build/modules/chain/chain.schema.d.ts +0 -323
- package/build/modules/chain/chain.schema.js +0 -41
- package/build/modules/chain/chain.schema.js.map +0 -1
- package/build/modules/chain/chain.service.d.ts +0 -15
- package/build/modules/chain/chain.service.js +0 -115
- package/build/modules/chain/chain.service.js.map +0 -1
- package/build/modules/chain/chain.types.d.ts +0 -20
- package/build/modules/chain/chain.types.js +0 -2
- package/build/modules/chain/chain.types.js.map +0 -1
- package/build/modules/chain/index.d.ts +0 -5
- package/build/modules/chain/index.js +0 -6
- package/build/modules/chain/index.js.map +0 -1
- package/build/modules/character/character.models.d.ts +0 -14
- package/build/modules/character/character.models.js +0 -123
- package/build/modules/character/character.models.js.map +0 -1
- package/build/modules/character/character.router.d.ts +0 -945
- package/build/modules/character/character.router.js +0 -246
- package/build/modules/character/character.router.js.map +0 -1
- package/build/modules/character/character.schema.d.ts +0 -1239
- package/build/modules/character/character.schema.js +0 -67
- package/build/modules/character/character.schema.js.map +0 -1
- package/build/modules/character/character.service.d.ts +0 -73
- package/build/modules/character/character.service.js +0 -533
- package/build/modules/character/character.service.js.map +0 -1
- package/build/modules/character/character.types.d.ts +0 -48
- package/build/modules/character/character.types.js +0 -2
- package/build/modules/character/character.types.js.map +0 -1
- package/build/modules/character/index.d.ts +0 -5
- package/build/modules/character/index.js +0 -6
- package/build/modules/character/index.js.map +0 -1
- package/build/modules/chat/chat.models.d.ts +0 -4
- package/build/modules/chat/chat.models.js +0 -35
- package/build/modules/chat/chat.models.js.map +0 -1
- package/build/modules/chat/chat.router.d.ts +0 -223
- package/build/modules/chat/chat.router.js +0 -51
- package/build/modules/chat/chat.router.js.map +0 -1
- package/build/modules/chat/chat.schema.d.ts +0 -183
- package/build/modules/chat/chat.schema.js +0 -29
- package/build/modules/chat/chat.schema.js.map +0 -1
- package/build/modules/chat/chat.service.d.ts +0 -12
- package/build/modules/chat/chat.service.js +0 -85
- package/build/modules/chat/chat.service.js.map +0 -1
- package/build/modules/chat/chat.types.d.ts +0 -14
- package/build/modules/chat/chat.types.js +0 -2
- package/build/modules/chat/chat.types.js.map +0 -1
- package/build/modules/chat/index.d.ts +0 -5
- package/build/modules/chat/index.js +0 -6
- package/build/modules/chat/index.js.map +0 -1
- package/build/modules/collection/collection.models.d.ts +0 -9
- package/build/modules/collection/collection.models.js +0 -69
- package/build/modules/collection/collection.models.js.map +0 -1
- package/build/modules/collection/collection.router.d.ts +0 -361
- package/build/modules/collection/collection.router.js +0 -71
- package/build/modules/collection/collection.router.js.map +0 -1
- package/build/modules/collection/collection.schema.d.ts +0 -676
- package/build/modules/collection/collection.schema.js +0 -70
- package/build/modules/collection/collection.schema.js.map +0 -1
- package/build/modules/collection/collection.service.d.ts +0 -15
- package/build/modules/collection/collection.service.js +0 -117
- package/build/modules/collection/collection.service.js.map +0 -1
- package/build/modules/collection/collection.types.d.ts +0 -29
- package/build/modules/collection/collection.types.js +0 -2
- package/build/modules/collection/collection.types.js.map +0 -1
- package/build/modules/collection/index.d.ts +0 -5
- package/build/modules/collection/index.js +0 -6
- package/build/modules/collection/index.js.map +0 -1
- package/build/modules/core/core.models.d.ts +0 -123
- package/build/modules/core/core.models.js +0 -811
- package/build/modules/core/core.models.js.map +0 -1
- package/build/modules/core/core.router.d.ts +0 -5297
- package/build/modules/core/core.router.js +0 -1372
- package/build/modules/core/core.router.js.map +0 -1
- package/build/modules/core/core.schema.d.ts +0 -5918
- package/build/modules/core/core.schema.js +0 -519
- package/build/modules/core/core.schema.js.map +0 -1
- package/build/modules/core/core.service.d.ts +0 -270
- package/build/modules/core/core.service.js +0 -2515
- package/build/modules/core/core.service.js.map +0 -1
- package/build/modules/core/core.types.d.ts +0 -251
- package/build/modules/core/core.types.js +0 -2
- package/build/modules/core/core.types.js.map +0 -1
- package/build/modules/core/index.d.ts +0 -5
- package/build/modules/core/index.js +0 -6
- package/build/modules/core/index.js.map +0 -1
- package/build/modules/core/mail/applyPatchesOrMail.d.ts +0 -72
- package/build/modules/core/mail/applyPatchesOrMail.js +0 -416
- package/build/modules/core/mail/applyPatchesOrMail.js.map +0 -1
- package/build/modules/core/mail/mailClaimablePatchesBatch.d.ts +0 -51
- package/build/modules/core/mail/mailClaimablePatchesBatch.js +0 -239
- package/build/modules/core/mail/mailClaimablePatchesBatch.js.map +0 -1
- package/build/modules/game/game.models.d.ts +0 -6
- package/build/modules/game/game.models.js +0 -29
- package/build/modules/game/game.models.js.map +0 -1
- package/build/modules/game/game.router.d.ts +0 -428
- package/build/modules/game/game.router.js +0 -90
- package/build/modules/game/game.router.js.map +0 -1
- package/build/modules/game/game.schema.d.ts +0 -344
- package/build/modules/game/game.schema.js +0 -14
- package/build/modules/game/game.schema.js.map +0 -1
- package/build/modules/game/game.service.d.ts +0 -16
- package/build/modules/game/game.service.js +0 -111
- package/build/modules/game/game.service.js.map +0 -1
- package/build/modules/game/game.types.d.ts +0 -20
- package/build/modules/game/game.types.js +0 -2
- package/build/modules/game/game.types.js.map +0 -1
- package/build/modules/game/index.d.ts +0 -5
- package/build/modules/game/index.js +0 -5
- package/build/modules/game/index.js.map +0 -1
- package/build/modules/interface/index.d.ts +0 -5
- package/build/modules/interface/index.js +0 -6
- package/build/modules/interface/index.js.map +0 -1
- package/build/modules/interface/interface.canonicalize.d.ts +0 -2
- package/build/modules/interface/interface.canonicalize.js +0 -241
- package/build/modules/interface/interface.canonicalize.js.map +0 -1
- package/build/modules/interface/interface.models.d.ts +0 -6
- package/build/modules/interface/interface.models.js +0 -30
- package/build/modules/interface/interface.models.js.map +0 -1
- package/build/modules/interface/interface.router.d.ts +0 -472
- package/build/modules/interface/interface.router.js +0 -113
- package/build/modules/interface/interface.router.js.map +0 -1
- package/build/modules/interface/interface.schema.d.ts +0 -313
- package/build/modules/interface/interface.schema.js +0 -36
- package/build/modules/interface/interface.schema.js.map +0 -1
- package/build/modules/interface/interface.service.d.ts +0 -19
- package/build/modules/interface/interface.service.js +0 -168
- package/build/modules/interface/interface.service.js.map +0 -1
- package/build/modules/interface/interface.types.d.ts +0 -19
- package/build/modules/interface/interface.types.js +0 -2
- package/build/modules/interface/interface.types.js.map +0 -1
- package/build/modules/item/index.d.ts +0 -5
- package/build/modules/item/index.js +0 -6
- package/build/modules/item/index.js.map +0 -1
- package/build/modules/item/item.models.d.ts +0 -16
- package/build/modules/item/item.models.js +0 -101
- package/build/modules/item/item.models.js.map +0 -1
- package/build/modules/item/item.router.d.ts +0 -263
- package/build/modules/item/item.router.js +0 -70
- package/build/modules/item/item.router.js.map +0 -1
- package/build/modules/item/item.schema.d.ts +0 -778
- package/build/modules/item/item.schema.js +0 -56
- package/build/modules/item/item.schema.js.map +0 -1
- package/build/modules/item/item.service.d.ts +0 -13
- package/build/modules/item/item.service.js +0 -116
- package/build/modules/item/item.service.js.map +0 -1
- package/build/modules/item/item.types.d.ts +0 -55
- package/build/modules/item/item.types.js +0 -2
- package/build/modules/item/item.types.js.map +0 -1
- package/build/modules/job/index.d.ts +0 -5
- package/build/modules/job/index.js +0 -6
- package/build/modules/job/index.js.map +0 -1
- package/build/modules/job/job.models.d.ts +0 -3
- package/build/modules/job/job.models.js +0 -9
- package/build/modules/job/job.models.js.map +0 -1
- package/build/modules/job/job.router.d.ts +0 -146
- package/build/modules/job/job.router.js +0 -32
- package/build/modules/job/job.router.js.map +0 -1
- package/build/modules/job/job.schema.d.ts +0 -67
- package/build/modules/job/job.schema.js +0 -7
- package/build/modules/job/job.schema.js.map +0 -1
- package/build/modules/job/job.service.d.ts +0 -7
- package/build/modules/job/job.service.js +0 -144
- package/build/modules/job/job.service.js.map +0 -1
- package/build/modules/job/job.types.d.ts +0 -16
- package/build/modules/job/job.types.js +0 -2
- package/build/modules/job/job.types.js.map +0 -1
- package/build/modules/market/index.d.ts +0 -5
- package/build/modules/market/index.js +0 -6
- package/build/modules/market/index.js.map +0 -1
- package/build/modules/market/market.models.d.ts +0 -14
- package/build/modules/market/market.models.js +0 -98
- package/build/modules/market/market.models.js.map +0 -1
- package/build/modules/market/market.router.d.ts +0 -230
- package/build/modules/market/market.router.js +0 -56
- package/build/modules/market/market.router.js.map +0 -1
- package/build/modules/market/market.schema.d.ts +0 -949
- package/build/modules/market/market.schema.js +0 -101
- package/build/modules/market/market.schema.js.map +0 -1
- package/build/modules/market/market.service.d.ts +0 -12
- package/build/modules/market/market.service.js +0 -88
- package/build/modules/market/market.service.js.map +0 -1
- package/build/modules/market/market.types.d.ts +0 -49
- package/build/modules/market/market.types.js +0 -2
- package/build/modules/market/market.types.js.map +0 -1
- package/build/modules/product/index.d.ts +0 -5
- package/build/modules/product/index.js +0 -6
- package/build/modules/product/index.js.map +0 -1
- package/build/modules/product/product.models.d.ts +0 -4
- package/build/modules/product/product.models.js +0 -113
- package/build/modules/product/product.models.js.map +0 -1
- package/build/modules/product/product.router.d.ts +0 -447
- package/build/modules/product/product.router.js +0 -71
- package/build/modules/product/product.router.js.map +0 -1
- package/build/modules/product/product.schema.d.ts +0 -654
- package/build/modules/product/product.schema.js +0 -117
- package/build/modules/product/product.schema.js.map +0 -1
- package/build/modules/product/product.service.d.ts +0 -15
- package/build/modules/product/product.service.js +0 -115
- package/build/modules/product/product.service.js.map +0 -1
- package/build/modules/product/product.types.d.ts +0 -28
- package/build/modules/product/product.types.js +0 -2
- package/build/modules/product/product.types.js.map +0 -1
- package/build/modules/profile/index.d.ts +0 -5
- package/build/modules/profile/index.js +0 -6
- package/build/modules/profile/index.js.map +0 -1
- package/build/modules/profile/profile.models.d.ts +0 -2
- package/build/modules/profile/profile.models.js +0 -165
- package/build/modules/profile/profile.models.js.map +0 -1
- package/build/modules/profile/profile.router.d.ts +0 -163
- package/build/modules/profile/profile.router.js +0 -54
- package/build/modules/profile/profile.router.js.map +0 -1
- package/build/modules/profile/profile.schema.d.ts +0 -1
- package/build/modules/profile/profile.schema.js +0 -138
- package/build/modules/profile/profile.schema.js.map +0 -1
- package/build/modules/profile/profile.service.d.ts +0 -11
- package/build/modules/profile/profile.service.js +0 -120
- package/build/modules/profile/profile.service.js.map +0 -1
- package/build/modules/profile/profile.types.d.ts +0 -16
- package/build/modules/profile/profile.types.js +0 -2
- package/build/modules/profile/profile.types.js.map +0 -1
- package/build/modules/raffle/index.d.ts +0 -5
- package/build/modules/raffle/index.js +0 -6
- package/build/modules/raffle/index.js.map +0 -1
- package/build/modules/raffle/raffle.models.d.ts +0 -6
- package/build/modules/raffle/raffle.models.js +0 -36
- package/build/modules/raffle/raffle.models.js.map +0 -1
- package/build/modules/raffle/raffle.router.d.ts +0 -299
- package/build/modules/raffle/raffle.router.js +0 -71
- package/build/modules/raffle/raffle.router.js.map +0 -1
- package/build/modules/raffle/raffle.schema.d.ts +0 -265
- package/build/modules/raffle/raffle.schema.js +0 -21
- package/build/modules/raffle/raffle.schema.js.map +0 -1
- package/build/modules/raffle/raffle.service.d.ts +0 -15
- package/build/modules/raffle/raffle.service.js +0 -115
- package/build/modules/raffle/raffle.service.js.map +0 -1
- package/build/modules/raffle/raffle.types.d.ts +0 -25
- package/build/modules/raffle/raffle.types.js +0 -2
- package/build/modules/raffle/raffle.types.js.map +0 -1
- package/build/modules/skill/index.d.ts +0 -5
- package/build/modules/skill/index.js +0 -6
- package/build/modules/skill/index.js.map +0 -1
- package/build/modules/skill/skill.models.d.ts +0 -9
- package/build/modules/skill/skill.models.js +0 -9
- package/build/modules/skill/skill.models.js.map +0 -1
- package/build/modules/skill/skill.router.d.ts +0 -659
- package/build/modules/skill/skill.router.js +0 -152
- package/build/modules/skill/skill.router.js.map +0 -1
- package/build/modules/skill/skill.schema.d.ts +0 -548
- package/build/modules/skill/skill.schema.js +0 -26
- package/build/modules/skill/skill.schema.js.map +0 -1
- package/build/modules/skill/skill.service.d.ts +0 -32
- package/build/modules/skill/skill.service.js +0 -279
- package/build/modules/skill/skill.service.js.map +0 -1
- package/build/modules/skill/skill.types.d.ts +0 -29
- package/build/modules/skill/skill.types.js +0 -2
- package/build/modules/skill/skill.types.js.map +0 -1
- package/build/modules/video/index.d.ts +0 -5
- package/build/modules/video/index.js +0 -6
- package/build/modules/video/index.js.map +0 -1
- package/build/modules/video/video.models.d.ts +0 -7
- package/build/modules/video/video.models.js +0 -19
- package/build/modules/video/video.models.js.map +0 -1
- package/build/modules/video/video.router.d.ts +0 -563
- package/build/modules/video/video.router.js +0 -112
- package/build/modules/video/video.router.js.map +0 -1
- package/build/modules/video/video.schema.d.ts +0 -456
- package/build/modules/video/video.schema.js +0 -31
- package/build/modules/video/video.schema.js.map +0 -1
- package/build/modules/video/video.service.d.ts +0 -23
- package/build/modules/video/video.service.js +0 -197
- package/build/modules/video/video.service.js.map +0 -1
- package/build/modules/video/video.types.d.ts +0 -28
- package/build/modules/video/video.types.js +0 -2
- package/build/modules/video/video.types.js.map +0 -1
- package/build/router.d.ts +0 -10406
- package/build/router.js +0 -44
- package/build/router.js.map +0 -1
- package/build/types.d.ts +0 -164
- package/build/types.js +0 -19
- package/build/types.js.map +0 -1
- package/build/util/api.js.map +0 -1
- package/build/util/array.js.map +0 -1
- package/build/util/browser.js.map +0 -1
- package/build/util/codebase.js.map +0 -1
- package/build/util/config.js.map +0 -1
- package/build/util/db/index.d.ts +0 -5
- package/build/util/db/index.js +0 -7
- package/build/util/db/index.js.map +0 -1
- package/build/util/db/isPostgresError.d.ts +0 -2
- package/build/util/db/isPostgresError.js +0 -8
- package/build/util/db/isPostgresError.js.map +0 -1
- package/build/util/db/isUniqueConstraintViolation.d.ts +0 -2
- package/build/util/db/isUniqueConstraintViolation.js +0 -3
- package/build/util/db/isUniqueConstraintViolation.js.map +0 -1
- package/build/util/db.d.ts +0 -6
- package/build/util/db.js +0 -51
- package/build/util/db.js.map +0 -1
- package/build/util/decoder.js.map +0 -1
- package/build/util/decoder.test.d.ts +0 -1
- package/build/util/decoder.test.js +0 -7
- package/build/util/decoder.test.js.map +0 -1
- package/build/util/format.js.map +0 -1
- package/build/util/guid.js.map +0 -1
- package/build/util/index.d.ts +0 -74
- package/build/util/index.js +0 -239
- package/build/util/index.js.map +0 -1
- package/build/util/json.js.map +0 -1
- package/build/util/log.d.ts +0 -1
- package/build/util/log.js +0 -6
- package/build/util/log.js.map +0 -1
- package/build/util/math.js.map +0 -1
- package/build/util/merkle.js.map +0 -1
- package/build/util/mongo.js.map +0 -1
- package/build/util/number.js.map +0 -1
- package/build/util/object.js.map +0 -1
- package/build/util/otp.js.map +0 -1
- package/build/util/physics.js.map +0 -1
- package/build/util/process.js.map +0 -1
- package/build/util/rpc.js.map +0 -1
- package/build/util/seer.js.map +0 -1
- package/build/util/string.js.map +0 -1
- package/build/util/text.js.map +0 -1
- package/build/util/time/date.js.map +0 -1
- package/build/util/time/fancyTimeFormat.js.map +0 -1
- package/build/util/time/index.js.map +0 -1
- package/build/util/time/now.js.map +0 -1
- package/build/util/web3/httpProvider.js.map +0 -1
- package/build/util/web3.js.map +0 -1
- package/build/util/websocket.js.map +0 -1
- package/build/util/zk.js.map +0 -1
- package/build/util/zod.js.map +0 -1
- package/modules/area/area.models.ts +0 -15
- package/modules/area/area.router.ts +0 -74
- package/modules/area/area.schema.ts +0 -22
- package/modules/area/area.service.ts +0 -124
- package/modules/area/area.types.ts +0 -26
- package/modules/area/index.ts +0 -5
- package/modules/asset/asset.models.ts +0 -59
- package/modules/asset/asset.router.ts +0 -55
- package/modules/asset/asset.schema.ts +0 -27
- package/modules/asset/asset.service.ts +0 -85
- package/modules/asset/asset.types.ts +0 -22
- package/modules/asset/index.ts +0 -5
- package/modules/chain/chain.models.ts +0 -50
- package/modules/chain/chain.router.ts +0 -104
- package/modules/chain/chain.schema.ts +0 -52
- package/modules/chain/chain.service.ts +0 -167
- package/modules/chain/chain.types.ts +0 -24
- package/modules/chain/index.ts +0 -5
- package/modules/character/character.models.ts +0 -174
- package/modules/character/character.router.ts +0 -314
- package/modules/character/character.schema.ts +0 -147
- package/modules/character/character.service.ts +0 -876
- package/modules/character/character.types.ts +0 -64
- package/modules/character/index.ts +0 -5
- package/modules/chat/chat.models.ts +0 -43
- package/modules/chat/chat.router.ts +0 -67
- package/modules/chat/chat.schema.ts +0 -36
- package/modules/chat/chat.service.ts +0 -128
- package/modules/chat/chat.types.ts +0 -20
- package/modules/chat/index.ts +0 -5
- package/modules/collection/collection.models.ts +0 -76
- package/modules/collection/collection.router.ts +0 -91
- package/modules/collection/collection.schema.ts +0 -90
- package/modules/collection/collection.service.ts +0 -192
- package/modules/collection/collection.types.ts +0 -36
- package/modules/collection/index.ts +0 -5
- package/modules/core/core.models.ts +0 -1380
- package/modules/core/core.router.ts +0 -1781
- package/modules/core/core.schema.ts +0 -847
- package/modules/core/core.service.ts +0 -2824
- package/modules/core/core.types.ts +0 -340
- package/modules/core/index.ts +0 -5
- package/modules/core/mail/applyPatchesOrMail.ts +0 -568
- package/modules/core/mail/mailClaimablePatchesBatch.ts +0 -381
- package/modules/game/game.models.ts +0 -53
- package/modules/game/game.router.ts +0 -110
- package/modules/game/game.schema.ts +0 -23
- package/modules/game/game.service.ts +0 -143
- package/modules/game/game.types.ts +0 -28
- package/modules/game/index.ts +0 -5
- package/modules/interface/index.ts +0 -5
- package/modules/interface/interface.canonicalize.ts +0 -279
- package/modules/interface/interface.models.ts +0 -40
- package/modules/interface/interface.router.ts +0 -175
- package/modules/interface/interface.schema.ts +0 -59
- package/modules/interface/interface.service.ts +0 -356
- package/modules/interface/interface.types.ts +0 -25
- package/modules/item/index.ts +0 -5
- package/modules/item/item.models.ts +0 -124
- package/modules/item/item.router.ts +0 -103
- package/modules/item/item.schema.ts +0 -120
- package/modules/item/item.service.ts +0 -167
- package/modules/item/item.types.ts +0 -74
- package/modules/job/index.ts +0 -5
- package/modules/job/job.models.ts +0 -14
- package/modules/job/job.router.ts +0 -44
- package/modules/job/job.schema.ts +0 -9
- package/modules/job/job.service.ts +0 -243
- package/modules/job/job.types.ts +0 -23
- package/modules/market/index.ts +0 -5
- package/modules/market/market.models.ts +0 -113
- package/modules/market/market.router.ts +0 -73
- package/modules/market/market.schema.ts +0 -140
- package/modules/market/market.service.ts +0 -122
- package/modules/market/market.types.ts +0 -56
- package/modules/product/index.ts +0 -5
- package/modules/product/product.models.ts +0 -166
- package/modules/product/product.router.ts +0 -93
- package/modules/product/product.schema.ts +0 -149
- package/modules/product/product.service.ts +0 -160
- package/modules/product/product.types.ts +0 -33
- package/modules/profile/index.ts +0 -5
- package/modules/profile/profile.models.ts +0 -214
- package/modules/profile/profile.router.ts +0 -72
- package/modules/profile/profile.schema.ts +0 -156
- package/modules/profile/profile.service.ts +0 -149
- package/modules/profile/profile.types.ts +0 -22
- package/modules/raffle/index.ts +0 -5
- package/modules/raffle/raffle.models.ts +0 -44
- package/modules/raffle/raffle.router.ts +0 -90
- package/modules/raffle/raffle.schema.ts +0 -32
- package/modules/raffle/raffle.service.ts +0 -167
- package/modules/raffle/raffle.types.ts +0 -30
- package/modules/skill/index.ts +0 -5
- package/modules/skill/skill.models.ts +0 -16
- package/modules/skill/skill.router.ts +0 -201
- package/modules/skill/skill.schema.ts +0 -40
- package/modules/skill/skill.service.ts +0 -390
- package/modules/skill/skill.types.ts +0 -33
- package/modules/video/index.ts +0 -5
- package/modules/video/video.models.ts +0 -25
- package/modules/video/video.router.ts +0 -143
- package/modules/video/video.schema.ts +0 -46
- package/modules/video/video.service.ts +0 -274
- package/modules/video/video.types.ts +0 -33
- package/router.ts +0 -49
- package/types.ts +0 -183
- package/util/db/index.ts +0 -7
- package/util/db/isPostgresError.ts +0 -9
- package/util/db/isUniqueConstraintViolation.ts +0 -3
- package/util/db.ts +0 -62
- package/util/index.ts +0 -351
- package/util/log.ts +0 -5
- /package/{util/api.ts → api.ts} +0 -0
- /package/{util/array.ts → array.ts} +0 -0
- /package/{util/browser.ts → browser.ts} +0 -0
- /package/build/{util/api.d.ts → api.d.ts} +0 -0
- /package/build/{util/api.js → api.js} +0 -0
- /package/build/{util/array.d.ts → array.d.ts} +0 -0
- /package/build/{util/array.js → array.js} +0 -0
- /package/build/{util/browser.d.ts → browser.d.ts} +0 -0
- /package/build/{util/browser.js → browser.js} +0 -0
- /package/build/{util/codebase.d.ts → codebase.d.ts} +0 -0
- /package/build/{util/codebase.js → codebase.js} +0 -0
- /package/build/{util/config.d.ts → config.d.ts} +0 -0
- /package/build/{util/config.js → config.js} +0 -0
- /package/build/{util/decoder.d.ts → decoder.d.ts} +0 -0
- /package/build/{util/format.d.ts → format.d.ts} +0 -0
- /package/build/{util/format.js → format.js} +0 -0
- /package/build/{util/guid.d.ts → guid.d.ts} +0 -0
- /package/build/{util/guid.js → guid.js} +0 -0
- /package/build/{util/json.d.ts → json.d.ts} +0 -0
- /package/build/{util/json.js → json.js} +0 -0
- /package/build/{util/math.d.ts → math.d.ts} +0 -0
- /package/build/{util/math.js → math.js} +0 -0
- /package/build/{util/merkle.d.ts → merkle.d.ts} +0 -0
- /package/build/{util/mongo.d.ts → mongo.d.ts} +0 -0
- /package/build/{util/number.d.ts → number.d.ts} +0 -0
- /package/build/{util/number.js → number.js} +0 -0
- /package/build/{util/object.d.ts → object.d.ts} +0 -0
- /package/build/{util/object.js → object.js} +0 -0
- /package/build/{util/otp.d.ts → otp.d.ts} +0 -0
- /package/build/{util/otp.js → otp.js} +0 -0
- /package/build/{util/physics.d.ts → physics.d.ts} +0 -0
- /package/build/{util/physics.js → physics.js} +0 -0
- /package/build/{util/process.d.ts → process.d.ts} +0 -0
- /package/build/{util/rpc.d.ts → rpc.d.ts} +0 -0
- /package/build/{util/rpc.js → rpc.js} +0 -0
- /package/build/{util/seer.d.ts → seer.d.ts} +0 -0
- /package/build/{util/seer.js → seer.js} +0 -0
- /package/build/{util/string.d.ts → string.d.ts} +0 -0
- /package/build/{util/string.js → string.js} +0 -0
- /package/build/{util/text.d.ts → text.d.ts} +0 -0
- /package/build/{util/text.js → text.js} +0 -0
- /package/build/{util/time → time}/date.d.ts +0 -0
- /package/build/{util/time → time}/date.js +0 -0
- /package/build/{util/time → time}/fancyTimeFormat.d.ts +0 -0
- /package/build/{util/time → time}/fancyTimeFormat.js +0 -0
- /package/build/{util/time → time}/index.d.ts +0 -0
- /package/build/{util/time → time}/index.js +0 -0
- /package/build/{util/time → time}/now.d.ts +0 -0
- /package/build/{util/time → time}/now.js +0 -0
- /package/build/{util/web3 → web3}/httpProvider.d.ts +0 -0
- /package/build/{util/web3 → web3}/httpProvider.js +0 -0
- /package/build/{util/web3.d.ts → web3.d.ts} +0 -0
- /package/build/{util/websocket.d.ts → websocket.d.ts} +0 -0
- /package/build/{util/zk.d.ts → zk.d.ts} +0 -0
- /package/build/{util/zk.js → zk.js} +0 -0
- /package/{util/codebase.ts → codebase.ts} +0 -0
- /package/{util/config.ts → config.ts} +0 -0
- /package/{util/decoder.test.ts → decoder.test.ts} +0 -0
- /package/{util/format.ts → format.ts} +0 -0
- /package/{util/guid.ts → guid.ts} +0 -0
- /package/{util/json.ts → json.ts} +0 -0
- /package/{util/math.ts → math.ts} +0 -0
- /package/{util/number.ts → number.ts} +0 -0
- /package/{util/object.ts → object.ts} +0 -0
- /package/{util/otp.ts → otp.ts} +0 -0
- /package/{util/physics.ts → physics.ts} +0 -0
- /package/{util/rpc.ts → rpc.ts} +0 -0
- /package/{util/seer.ts → seer.ts} +0 -0
- /package/{util/string.ts → string.ts} +0 -0
- /package/{util/text.ts → text.ts} +0 -0
- /package/{util/time → time}/date.ts +0 -0
- /package/{util/time → time}/fancyTimeFormat.ts +0 -0
- /package/{util/time → time}/index.ts +0 -0
- /package/{util/time → time}/now.ts +0 -0
- /package/{util/types → types}/mongo.d.ts +0 -0
- /package/{util/web3 → web3}/httpProvider.ts +0 -0
- /package/{util/zk.ts → zk.ts} +0 -0
package/build/util.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '.';
|
package/build/util.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.js","sourceRoot":"","sources":["../util.ts"],"names":[],"mappings":"AAAA,cAAc,GAAG,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"httpProvider.js","sourceRoot":"","sources":["../../web3/httpProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAKnC,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,mCAAmC,CAAC,CAAC,CAAC;AAExE,IAAI,cAAc,GAAG,EAAE,CAAC;AACxB,IAAI,iBAAiB,GAAG,CAAC,CAAC;AAC1B,IAAI,gBAAgB,GAAG,IAAI,CAAC;AAE5B,MAAM,YAAa,SAAQ,KAAK;IAI9B,YAAY,OAAe,EAAE,IAAY,EAAE,IAAS;QAClD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;IACpC,CAAC;CACF;AAED,MAAM,CAAC,OAAO,OAAO,QAAQ;IAQ3B,YAAY,GAAW;QACrB,cAAc,GAAG,cAAc,IAAI,EAAE,CAAC;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,eAAe,EAAE,mBAAmB,cAAc,EAAE,EAAE,CAAC;QAC9E,MAAM,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,QAAQ,CAAC,QAAQ,EAAE,EAAE,GAAG,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC;QAE1F,IAAI,OAAO,IAAI,YAAY,EAAE,CAAC;YAC5B,MAAM,IAAI,YAAY,CACpB,CAAC,EAAE,GAAG,YAAY,CAAC,KAAK,CAAC,KAAK,IAAI,IAAI,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,EACzE,CAAC,EAAE,GAAG,YAAY,CAAC,KAAK,CAAC,KAAK,IAAI,IAAI,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,EACtE,CAAC,EAAE,GAAG,YAAY,CAAC,KAAK,CAAC,KAAK,IAAI,IAAI,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CACvE,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,OAAO,YAAY,CAAC,MAAM,CAAC;QAC7B,CAAC;IACH,CAAC;CACF"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _Web3 from 'web3';
|
|
2
2
|
import HDWalletProvider from '@truffle/hdwallet-provider';
|
|
3
3
|
import CryptoJS from 'crypto-js';
|
|
4
|
-
import { log, logError } from '.';
|
|
5
4
|
import { ethers } from 'ethers';
|
|
5
|
+
import { log, logError } from './log';
|
|
6
6
|
export const Web3 = _Web3;
|
|
7
7
|
export const getRandomProvider = (secret) => {
|
|
8
8
|
return new HDWalletProvider(secret.mnemonic, process.env.PROVIDER_URI);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web3.js","sourceRoot":"","sources":["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OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC,GAAG,EAAE,EAAE;IACjD,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QAC5B,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC;QAC3B,IAAI,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC;YAC1B,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;QACzC,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;AAEb,eAAe,GAAG,EAAE,GAAE,CAAC,CAAC"}
|
package/db.ts
CHANGED
|
@@ -11,10 +11,85 @@ import mongoose, {
|
|
|
11
11
|
Mongoose,
|
|
12
12
|
Query,
|
|
13
13
|
} from 'mongoose';
|
|
14
|
-
import { Model } from './
|
|
14
|
+
import { Model } from './mongo';
|
|
15
15
|
import safeStringify from 'fast-safe-stringify';
|
|
16
16
|
import fsPath from 'path';
|
|
17
17
|
|
|
18
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
19
|
+
import _ from 'lodash';
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
export function isPostgresError (error: unknown): boolean {
|
|
23
|
+
if (!error) {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return _.every(['severity', 'code', 'detail', 'internalQuery', 'routine'], (attr) => _.has(error as object, attr));
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export function isUniqueConstraintViolation (error) { return isPostgresError(error) && error.code === '23505' }
|
|
31
|
+
|
|
32
|
+
export function generateLongId(): string {
|
|
33
|
+
return uuidv4().toUpperCase();
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function generateShortId() {
|
|
37
|
+
const timestamp = ((new Date().getTime() / 1000) | 0).toString(16);
|
|
38
|
+
return timestamp + 'xxxxxxxxxxxxxxxx'.replace(/[x]/g, () => ((Math.random() * 16) | 0).toString(16)).toLowerCase();
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export const uuidFormat = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx';
|
|
42
|
+
|
|
43
|
+
export function generateLongId2(): string {
|
|
44
|
+
return uuidFormat
|
|
45
|
+
.replace(/[xy]/g, (c) => {
|
|
46
|
+
const r = (Math.random() * 16) | 0;
|
|
47
|
+
const v = c === 'x' ? r : (r & 0x3) | 0x8;
|
|
48
|
+
return v.toString(16);
|
|
49
|
+
})
|
|
50
|
+
.toUpperCase();
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function decodeRequest(data: any): any {
|
|
54
|
+
if (
|
|
55
|
+
data === undefined ||
|
|
56
|
+
data === null ||
|
|
57
|
+
typeof data === 'string' ||
|
|
58
|
+
typeof data === 'number' ||
|
|
59
|
+
typeof data === 'boolean'
|
|
60
|
+
)
|
|
61
|
+
return data;
|
|
62
|
+
|
|
63
|
+
if (Array.isArray(data)) {
|
|
64
|
+
return data.map(decodeRequest);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (typeof data !== 'object') return data;
|
|
68
|
+
|
|
69
|
+
const res: any = {};
|
|
70
|
+
|
|
71
|
+
for (const key in data) {
|
|
72
|
+
if (key === 'set') {
|
|
73
|
+
return data[key];
|
|
74
|
+
} else if (['create', 'connectOrCreate', 'upsert'].includes(key)) {
|
|
75
|
+
return decodeRequest(data[key]);
|
|
76
|
+
} else {
|
|
77
|
+
res[key] = decodeRequest(data[key]);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return Object.keys(res).length === 0 ? null : res;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export function escapeStringRegexp(string: string): string {
|
|
85
|
+
if (typeof string !== 'string') {
|
|
86
|
+
throw new TypeError('Expected a string');
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
return string.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&').replace(/-/g, '\\x2d');
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
|
|
18
93
|
let app: any;
|
|
19
94
|
let log: (...msgs: any[]) => void;
|
|
20
95
|
|
|
@@ -7,9 +7,9 @@ import {
|
|
|
7
7
|
itemData,
|
|
8
8
|
ItemRarity,
|
|
9
9
|
ItemRarityNameById,
|
|
10
|
-
} from '
|
|
11
|
-
import { ItemsMainCategoriesType } from '
|
|
12
|
-
import ProbabilityCache from '
|
|
10
|
+
} from './legacy/data/items';
|
|
11
|
+
import { ItemsMainCategoriesType } from './legacy/data/items.type';
|
|
12
|
+
import ProbabilityCache from './legacy/data/probabilityCache';
|
|
13
13
|
import { average, randInt } from './math';
|
|
14
14
|
|
|
15
15
|
const useLocalStorage = false;
|
package/index.ts
CHANGED
|
@@ -1,18 +1,306 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import crypto from 'crypto';
|
|
2
|
+
import { exec } from 'child_process';
|
|
3
|
+
// import jetpack from 'fs-jetpack';
|
|
4
|
+
import * as ethers from 'ethers';
|
|
5
|
+
import _ from 'lodash';
|
|
6
|
+
import config from './config';
|
|
7
|
+
import * as time from './time';
|
|
8
|
+
import * as objects from './object';
|
|
9
|
+
import * as db from './db';
|
|
10
|
+
import * as api from './api';
|
|
11
|
+
import * as guid from './guid';
|
|
12
|
+
import * as number from './number';
|
|
13
|
+
import * as string from './string';
|
|
14
|
+
import * as log from './log';
|
|
15
|
+
import * as process2 from './process';
|
|
16
|
+
import * as web3 from './web3';
|
|
17
|
+
import * as math from './math';
|
|
18
|
+
import * as json from './json';
|
|
19
|
+
import * as format from './format';
|
|
20
|
+
import * as rpc from './rpc';
|
|
21
|
+
// import * as browser from './browser';
|
|
22
|
+
|
|
23
|
+
export * as decoder from './decoder';
|
|
24
|
+
|
|
25
|
+
export function wait(ms) {
|
|
26
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function round(num, precision) {
|
|
30
|
+
const _precision = 10 ** precision;
|
|
31
|
+
return Math.ceil(num * _precision) / _precision;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function pad(n, width, z = '0') {
|
|
35
|
+
const nn = n + '';
|
|
36
|
+
return nn.length >= width ? nn : new Array(width - nn.length + 1).join(z) + nn;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function removeDupes(list) {
|
|
40
|
+
const seen = {};
|
|
41
|
+
return list.filter(function (item) {
|
|
42
|
+
const k1 = item.seller + item.tokenId + item.blockNumber;
|
|
43
|
+
const k2 = item.id;
|
|
44
|
+
const exists = seen.hasOwnProperty(k1) || seen.hasOwnProperty(k2);
|
|
45
|
+
|
|
46
|
+
if (!exists) {
|
|
47
|
+
seen[k1] = true;
|
|
48
|
+
seen[k2] = true;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return !exists;
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export const toLong = (x, decimals = 16) =>
|
|
56
|
+
decimals === 16 ? ethers.utils.parseEther(x + '') : ethers.utils.parseUnits(x + '', decimals);
|
|
57
|
+
export const toShort = (x) => round(parseFloat(ethers.utils.formatEther(x)), 4);
|
|
58
|
+
|
|
59
|
+
let updatingGit = false;
|
|
60
|
+
|
|
61
|
+
export async function updateGit() {
|
|
62
|
+
if (updatingGit) return;
|
|
63
|
+
|
|
64
|
+
updatingGit = true;
|
|
65
|
+
try {
|
|
66
|
+
const execPromise = require('util').promisify(exec);
|
|
67
|
+
|
|
68
|
+
try {
|
|
69
|
+
await execPromise('rm ./db/.git/index.lock');
|
|
70
|
+
} catch (e2) {}
|
|
71
|
+
|
|
72
|
+
const { stdout, stderr } = await execPromise(
|
|
73
|
+
'cd db && git add -A && git commit -m "build: Binzy doz it" && git push --set-upstream origin master'
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
console.log(stderr, stdout);
|
|
77
|
+
|
|
78
|
+
await wait(100);
|
|
79
|
+
} catch (e) {
|
|
80
|
+
console.log(e);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
updatingGit = false;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export function groupBySub(xs, key, subkey) {
|
|
87
|
+
return (
|
|
88
|
+
xs.reduce(function (rv, x) {
|
|
89
|
+
if (!x[key][subkey]) return rv;
|
|
90
|
+
(rv[x[key][subkey]] = rv[x[key][subkey]] || []).push(x);
|
|
91
|
+
return rv;
|
|
92
|
+
}, {}) || null
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export function groupBy(xs, key) {
|
|
97
|
+
return (
|
|
98
|
+
xs.reduce(function (rv, x) {
|
|
99
|
+
if (!x[key]) return rv;
|
|
100
|
+
(rv[x[key]] = rv[x[key]] || []).push(x);
|
|
101
|
+
return rv;
|
|
102
|
+
}, {}) || null
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export function getHighestId(arr) {
|
|
107
|
+
let highest = 0;
|
|
108
|
+
|
|
109
|
+
for (const item of arr) {
|
|
110
|
+
if (item.id > highest) {
|
|
111
|
+
highest = item.id;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
return highest;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export function average(arr) {
|
|
119
|
+
return arr.reduce((p, c) => p + c, 0) / arr.length;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export function ordinalise(n) {
|
|
123
|
+
return (
|
|
124
|
+
n +
|
|
125
|
+
(n % 10 == 1 && n % 100 != 11
|
|
126
|
+
? 'st'
|
|
127
|
+
: n % 10 == 2 && n % 100 != 12
|
|
128
|
+
? 'nd'
|
|
129
|
+
: n % 10 == 3 && n % 100 != 13
|
|
130
|
+
? 'rd'
|
|
131
|
+
: 'th')
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
export function commarise(n) {
|
|
135
|
+
return n.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export function getTime() {
|
|
139
|
+
return new Date().getTime();
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export const capitalizeFirstLetters = (text?: string) => text != null && _.startCase(text?.toLowerCase());
|
|
143
|
+
|
|
144
|
+
export function convertToDecimal(byte) {
|
|
145
|
+
let result = 0;
|
|
146
|
+
|
|
147
|
+
byte = byte.split('');
|
|
148
|
+
|
|
149
|
+
byte.reverse();
|
|
150
|
+
|
|
151
|
+
for (let a = 0; a < byte.length; a++) {
|
|
152
|
+
if (byte[a] === '1') {
|
|
153
|
+
result += 2 ** a;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
return result;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export const phoneMask = (phone: string) => {
|
|
161
|
+
//This regular expression provides the pattern for a phone number in format 000-000-0000
|
|
162
|
+
const x = phone.replace(/\D/g, '').match(/(\d{0,3})(\d{0,3})(\d{0,4})/);
|
|
163
|
+
return !x[2] ? x[1] : x[1] + '-' + x[2] + (x[3] ? '-' + x[3] : '');
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
export function binaryAgent(str) {
|
|
167
|
+
let bytes = str.split(' ');
|
|
168
|
+
let output = '';
|
|
169
|
+
|
|
170
|
+
for (let k = 0; k < bytes.length; k++) {
|
|
171
|
+
if (bytes[k]) output += String.fromCharCode(convertToDecimal(bytes[k]));
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
return output;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export function decodePayload(msg) {
|
|
178
|
+
try {
|
|
179
|
+
if (typeof msg === 'object') return msg;
|
|
180
|
+
|
|
181
|
+
// @ts-ignore
|
|
182
|
+
let json = binaryAgent(msg); //String.fromCharCode.apply(null, new Uint8Array(msg));
|
|
183
|
+
// else if (Buffer.isBuffer(msg)) json = msg.toString();
|
|
184
|
+
|
|
185
|
+
// explicitly decode the String as UTF-8 for Unicode
|
|
186
|
+
// https://github.com/mathiasbynens/utf8.js
|
|
187
|
+
// json = utf8.decode(json)
|
|
188
|
+
// const buffer = Buffer.from(json, "binary");
|
|
189
|
+
if (typeof json === 'string') return JSON.parse(json);
|
|
190
|
+
|
|
191
|
+
return json;
|
|
192
|
+
} catch (err) {
|
|
193
|
+
// ...
|
|
194
|
+
console.log(err, msg);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
export function isNumeric(str) {
|
|
199
|
+
if (typeof str != 'string') return false; // we only process strings!
|
|
200
|
+
return (
|
|
201
|
+
// @ts-ignore
|
|
202
|
+
!isNaN(str) && // use type coercion to parse the _entirety_ of the string (`parseFloat` alone does not do this)...
|
|
203
|
+
!isNaN(parseFloat(str))
|
|
204
|
+
); // ...and ensure strings of whitespace fail
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Wrapper around fetch with an optional timeout
|
|
209
|
+
* @param {Url} url
|
|
210
|
+
* @param {Request} request
|
|
211
|
+
* @param {number} timeout
|
|
212
|
+
*/
|
|
213
|
+
async function fetchWithTimeout(url, request, timeout) {
|
|
214
|
+
return Promise.race([
|
|
215
|
+
fetch(url, request),
|
|
216
|
+
new Promise((_, reject) => setTimeout(() => reject(new Error('Timeout')), timeout)),
|
|
217
|
+
]);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
export function sha256(str) {
|
|
221
|
+
return crypto.createHash('sha256').update(str, 'utf8').digest('base64');
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
// /**
|
|
225
|
+
// * sha256 encodes a given string message
|
|
226
|
+
// * @param {string} message
|
|
227
|
+
// * Borrowed from
|
|
228
|
+
// * https://developers.cloudflare.com/workers/examples/cache-api
|
|
229
|
+
// */
|
|
230
|
+
// async function sha256(message) {
|
|
231
|
+
// // encode as UTF-8
|
|
232
|
+
// const msgBuffer = new TextEncoder().encode(message)
|
|
233
|
+
// // hash the message
|
|
234
|
+
// const hashBuffer = await crypto.subtle.digest("SHA-256", msgBuffer)
|
|
235
|
+
// // convert ArrayBuffer to Array
|
|
236
|
+
// const hashArray = Array.from(new Uint8Array(hashBuffer))
|
|
237
|
+
// // convert bytes to hex string
|
|
238
|
+
// const hashHex = hashArray.map(b => ("00" + b.toString(16)).slice(-2)).join("")
|
|
239
|
+
// return hashHex
|
|
240
|
+
// }
|
|
241
|
+
|
|
242
|
+
export function randomPosition(min, max) {
|
|
243
|
+
return Math.random() * (max - min) + min;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
export function shuffleArray(array) {
|
|
247
|
+
for (let i = array.length - 1; i > 0; i--) {
|
|
248
|
+
const j = Math.floor(Math.random() * (i + 1));
|
|
249
|
+
[array[i], array[j]] = [array[j], array[i]];
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
return array;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
export const getAddress = (address) => {
|
|
256
|
+
const mainNetChainId = 56;
|
|
257
|
+
const chainId = window?.location?.hostname === 'testnet.arken.gg' ? 97 : process.env.REACT_APP_CHAIN_ID;
|
|
258
|
+
return address[chainId] ? address[chainId] : address[mainNetChainId];
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
export function random(min, max) {
|
|
262
|
+
return Math.floor(Math.random() * (max - min + 1)) + min;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
export const isEthereumAddress = (address: string) => {
|
|
266
|
+
// Regular expression to check if the string is a valid Ethereum address
|
|
267
|
+
return /^0x[a-fA-F0-9]{40}$/.test(address);
|
|
268
|
+
};
|
|
269
|
+
|
|
270
|
+
export const ipHashFromSocket = (socket) => {
|
|
271
|
+
const ip = socket.handshake.headers['x-forwarded-for']?.split(',')[0] || socket.conn.remoteAddress?.split(':')[3];
|
|
272
|
+
let hash = ip ? sha256(ip.slice(ip.length / 2)) : '';
|
|
273
|
+
hash = ip ? hash.slice(hash.length - 10, hash.length - 1) : '';
|
|
274
|
+
|
|
275
|
+
return hash;
|
|
276
|
+
};
|
|
277
|
+
|
|
278
|
+
export * as physics from './physics';
|
|
279
|
+
export * as number from './number';
|
|
280
|
+
export * as object from './object';
|
|
281
|
+
export * as api from './api';
|
|
282
|
+
export * as string from './string';
|
|
283
|
+
export * as web3 from './web3';
|
|
284
|
+
export * as math from './math';
|
|
285
|
+
export * as db from './db';
|
|
286
|
+
export * as time from './time';
|
|
287
|
+
export * as config from './config';
|
|
288
|
+
export * as rpc from './rpc';
|
|
289
|
+
|
|
290
|
+
export default {
|
|
291
|
+
objects,
|
|
292
|
+
api,
|
|
293
|
+
guid,
|
|
294
|
+
number,
|
|
295
|
+
string,
|
|
296
|
+
process: process2,
|
|
297
|
+
web3,
|
|
298
|
+
math,
|
|
299
|
+
json,
|
|
300
|
+
db,
|
|
301
|
+
format,
|
|
302
|
+
rpc,
|
|
303
|
+
// browser,
|
|
304
|
+
config,
|
|
305
|
+
time,
|
|
306
|
+
};
|
package/legacy/data/items.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { removeTimezoneOffset } from '../../
|
|
1
|
+
import { removeTimezoneOffset } from '../../time';
|
|
2
2
|
import ItemAttributes from './generated/itemAttributes.json';
|
|
3
3
|
import generatedItems from './generated/items.json';
|
|
4
4
|
import { ItemCategoriesType, ItemsMainCategoriesType } from './items.type';
|
package/log.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
const writeLogs = false;
|
|
3
|
+
const logPrefix = process.env.LOG_PREFIX || '[APP]';
|
|
4
|
+
|
|
5
|
+
export function nowReadable() {
|
|
6
|
+
return new Date().toISOString().replace(/T/, ' ').replace(/\..+/, '');
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function dev(...props: any) {
|
|
10
|
+
if (process.env.NODE_ENV === 'development') {
|
|
11
|
+
console.log(`[ARKEN]`, props);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const isDebug =
|
|
16
|
+
process.env.HOME === '/Users/dev' ||
|
|
17
|
+
process.env.HOME === '/home/dev' ||
|
|
18
|
+
process.env.HOME === '/root' ||
|
|
19
|
+
process.env.LOG === '1';
|
|
20
|
+
|
|
21
|
+
export function logError(...msgs) {
|
|
22
|
+
console.log(logPrefix, nowReadable(), ...msgs);
|
|
23
|
+
|
|
24
|
+
// const errorLog = jetpack.read(path.resolve('./public/data/errors.json'), 'json') || [];
|
|
25
|
+
|
|
26
|
+
// for (const msg of msgs) {
|
|
27
|
+
// errorLog.push(JSON.stringify(msg));
|
|
28
|
+
// }
|
|
29
|
+
|
|
30
|
+
if (writeLogs) {
|
|
31
|
+
// jetpack.write(path.resolve('./public/data/errors.json'), JSON.stringify(errorLog, null, 2), { atomic: true });
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// console.log(msgs);
|
|
35
|
+
|
|
36
|
+
// throw new Error(msgs.join('; '));
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function log(...msgs) {
|
|
40
|
+
if (isDebug) {
|
|
41
|
+
console.log(logPrefix, nowReadable(), ...msgs);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (writeLogs) {
|
|
45
|
+
// const logData = jetpack.read(path.resolve('../public/data/log.json'), 'json') || [];
|
|
46
|
+
// for (const msg of msgs) {
|
|
47
|
+
// logData.push(JSON.stringify(msg));
|
|
48
|
+
// }
|
|
49
|
+
// jetpack.write(path.resolve('./public/data/log.json'), JSON.stringify(logData, null, 2));
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -2,13 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
import keccak256 from 'keccak256';
|
|
4
4
|
import crypto from 'crypto';
|
|
5
|
-
import { MerkleNode } from '../modules/core/core.models';
|
|
5
|
+
// import { MerkleNode } from '../modules/core/core.models';
|
|
6
6
|
import { generateProof } from './zk'; // your UpdateLeaf zk utils
|
|
7
7
|
import { buildPoseidon } from 'circomlibjs';
|
|
8
8
|
|
|
9
9
|
const TREE_DEPTH = 16; // must match UpdateLeaf(16)
|
|
10
10
|
const TREE_SIZE = 1 << TREE_DEPTH;
|
|
11
11
|
|
|
12
|
+
const MerkleNode = {} as any; // todo: fix
|
|
13
|
+
|
|
12
14
|
// -----------------------------------------------------------------------------
|
|
13
15
|
// Poseidon setup
|
|
14
16
|
// -----------------------------------------------------------------------------
|
|
@@ -23,7 +23,7 @@ import { VirtualType, HydratedDocument } from 'mongoose';
|
|
|
23
23
|
|
|
24
24
|
export type { Mixed, ObjectIdSchemaDefinition, AnyArray, StringSchemaDefinition } from 'mongoose'; // Mixed type
|
|
25
25
|
import pluralize from 'pluralize';
|
|
26
|
-
import { toCamelCase } from '
|
|
26
|
+
import { toCamelCase } from './string';
|
|
27
27
|
export { z } from 'zod';
|
|
28
28
|
|
|
29
29
|
export { Schema } from 'mongoose';
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arken/node",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.3",
|
|
4
4
|
"description": "",
|
|
5
|
-
"main": "index.
|
|
6
|
-
"types": "types.ts",
|
|
5
|
+
"main": "build/index.js",
|
|
6
|
+
"types": "build/types.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build": "npm-run-all dist",
|
|
9
9
|
"clean": "del-cli ./build && make-dir ./build",
|
package/trpc/socketLink.ts
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
//
|
|
3
3
|
import { TRPCClientError, type TRPCLink, createTRPCProxyClient } from '@trpc/client';
|
|
4
4
|
import { observable } from '@trpc/server/observable';
|
|
5
|
-
import { serialize, deserialize } from '../
|
|
6
|
-
import { generateShortId } from '../
|
|
5
|
+
import { serialize, deserialize } from '../rpc';
|
|
6
|
+
import { generateShortId } from '../db';
|
|
7
7
|
|
|
8
8
|
// ======================
|
|
9
9
|
// Types
|
package/trpc/socketServer.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AnyRouter } from '@trpc/server';
|
|
2
|
-
import { serialize, deserialize } from '../
|
|
2
|
+
import { serialize, deserialize } from '../rpc';
|
|
3
3
|
|
|
4
4
|
export type CreateCallerFactory<TRouter extends AnyRouter = AnyRouter> = (router: TRouter) => (ctx: any) => any;
|
|
5
5
|
|