Skip to content

Make some APIs more flexible and fix corner-case encoding bugs #439

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

SpaceManiac
Copy link
Contributor

@SpaceManiac SpaceManiac commented Oct 26, 2024

  • Fix possible crash in presync on second run due to passing network name where caip2 is expected.
  • Allow getRelatedWallets to accept any IDatabaseConnection, not just PoolClient.
  • Make ERC721 primitive scheduledPrefix optional in case a game doesn't need to react to mint events.
  • Fix middleware buildQuery helper not escaping values; e.g. {"a": "b&c=d"} now properly round-trips.
  • Fix snapshots not saving if DB password contains special characters.
  • Fix getAdjustedHeight for emulated block mode always infinite looping.
  • Use toLowerCase instead of toLocaleLowerCase on wallet addresses to avoid theoretical problems if a server is ever run in Turkish locale.
  • Attempt to fix inconsistent CJS/ESM incompatibility issues with mina-signer by upgrading to a version that has native ESM support.
  • Tweak setAchievementProgress to keep existing completed_date if set.

SpaceManiac added a commit to PaimaStudios/tower-defense-backend that referenced this pull request Oct 29, 2024
- Remove external indexer dependencies in favor of Paima primitives
  - Add Hardhat configuration for AnnotatedMintNft contract, like Tarochi for Genesis Trainers
  - Use `Tarochi Genesis Trainer` entry in `extensions.$ENV.yml` to track NFT ownership
  - Track per-NFT win/lose stats in a new table, according to what NFT was selected when a lobby was created or joined
  - Fulfill relevant API routes:
    - `/account-nfts`
      - Includes all linked wallets
    - `/historical-owner` (currently ignores passed-in contract address and block height)
    - `/title-image` (currently ignores passed-in contract address)
    - `/nft-score` (currently ignores passed-in contract address)
- Add LocalWallet and wallet delegation handling
  - Add batcher startup configuration
  - Old middleware method `userWalletLogin` returns as soon as LocalWallet is ready
  - LocalWallet and batcher are used for most game transactions instead of requiring signing each time
  - New middleware method `externalWalletConnect` follows full delegation procedure and posts `&wd|` message to batcher
  - All API routes use "main wallet" when sensible
- Update a few more misc NPM packages

Future work:
- Test NFT-less play in non-debug builds
- Test/refine "main wallet" handling in API for corner cases, such as playing some NFT-less games then connecting a wallet

Depends on: PaimaStudios/paima-engine#439
SpaceManiac added a commit to PaimaStudios/tower-defense-backend that referenced this pull request Nov 6, 2024
- Add esbuild configuration so backend can be packed for deployment
- Minify middleware and add scripts to pack it properly for deployment
- Tweak Hardhat configs to be able to test emulated blocks
- Serve list of detected EVM wallets to frontend

See PaimaStudios/paima-engine#439
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant