@wopr-network/platform-core 1.66.0 → 1.66.1

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.
@@ -2,11 +2,11 @@
2
2
  -- Adds atomic derivation counter + path registry + address log.
3
3
 
4
4
  -- 1. Add network column to payment_methods (parallel to chain)
5
- ALTER TABLE "payment_methods" ADD COLUMN "network" text NOT NULL DEFAULT 'mainnet';
5
+ ALTER TABLE "payment_methods" ADD COLUMN IF NOT EXISTS "network" text NOT NULL DEFAULT 'mainnet';
6
6
  --> statement-breakpoint
7
7
 
8
8
  -- 2. Add next_index atomic counter to payment_methods
9
- ALTER TABLE "payment_methods" ADD COLUMN "next_index" integer NOT NULL DEFAULT 0;
9
+ ALTER TABLE "payment_methods" ADD COLUMN IF NOT EXISTS "next_index" integer NOT NULL DEFAULT 0;
10
10
  --> statement-breakpoint
11
11
 
12
12
  -- 3. BIP-44 path allocation registry
@@ -1,15 +1,15 @@
1
1
  -- Watcher service schema additions: webhook outbox + charge amount tracking.
2
2
 
3
3
  -- 1. callback_url for webhook delivery
4
- ALTER TABLE "crypto_charges" ADD COLUMN "callback_url" text;
4
+ ALTER TABLE "crypto_charges" ADD COLUMN IF NOT EXISTS "callback_url" text;
5
5
  --> statement-breakpoint
6
6
 
7
7
  -- 2. Expected crypto amount in native base units (locked at charge creation)
8
- ALTER TABLE "crypto_charges" ADD COLUMN "expected_amount" text;
8
+ ALTER TABLE "crypto_charges" ADD COLUMN IF NOT EXISTS "expected_amount" text;
9
9
  --> statement-breakpoint
10
10
 
11
11
  -- 3. Running total of received crypto in native base units (partial payments)
12
- ALTER TABLE "crypto_charges" ADD COLUMN "received_amount" text;
12
+ ALTER TABLE "crypto_charges" ADD COLUMN IF NOT EXISTS "received_amount" text;
13
13
  --> statement-breakpoint
14
14
 
15
15
  -- 4. Webhook delivery outbox — durable retry for payment callbacks
@@ -1,4 +1,4 @@
1
- ALTER TABLE "crypto_charges" ADD COLUMN "confirmations" integer DEFAULT 0 NOT NULL;--> statement-breakpoint
2
- ALTER TABLE "crypto_charges" ADD COLUMN "confirmations_required" integer DEFAULT 1 NOT NULL;--> statement-breakpoint
3
- ALTER TABLE "crypto_charges" ADD COLUMN "tx_hash" text;--> statement-breakpoint
4
- ALTER TABLE "crypto_charges" ADD COLUMN "amount_received_cents" integer DEFAULT 0 NOT NULL;
1
+ ALTER TABLE "crypto_charges" ADD COLUMN IF NOT EXISTS "confirmations" integer DEFAULT 0 NOT NULL;--> statement-breakpoint
2
+ ALTER TABLE "crypto_charges" ADD COLUMN IF NOT EXISTS "confirmations_required" integer DEFAULT 1 NOT NULL;--> statement-breakpoint
3
+ ALTER TABLE "crypto_charges" ADD COLUMN IF NOT EXISTS "tx_hash" text;--> statement-breakpoint
4
+ ALTER TABLE "crypto_charges" ADD COLUMN IF NOT EXISTS "amount_received_cents" integer DEFAULT 0 NOT NULL;
@@ -1,4 +1,4 @@
1
- ALTER TABLE "payment_methods" ADD COLUMN "encoding_params" text DEFAULT '{}' NOT NULL;
1
+ ALTER TABLE "payment_methods" ADD COLUMN IF NOT EXISTS "encoding_params" text DEFAULT '{}' NOT NULL;
2
2
  --> statement-breakpoint
3
3
  UPDATE "payment_methods" SET "encoding_params" = '{"hrp":"bc"}' WHERE "address_type" = 'bech32' AND "chain" = 'bitcoin';
4
4
  --> statement-breakpoint
@@ -1,3 +1,3 @@
1
- ALTER TABLE "payment_methods" ADD COLUMN "watcher_type" text DEFAULT 'evm' NOT NULL;
1
+ ALTER TABLE "payment_methods" ADD COLUMN IF NOT EXISTS "watcher_type" text DEFAULT 'evm' NOT NULL;
2
2
  --> statement-breakpoint
3
3
  UPDATE "payment_methods" SET "watcher_type" = 'utxo' WHERE "chain" IN ('bitcoin', 'litecoin', 'dogecoin');
@@ -1,4 +1,4 @@
1
- ALTER TABLE "payment_methods" ADD COLUMN "oracle_asset_id" text;
1
+ ALTER TABLE "payment_methods" ADD COLUMN IF NOT EXISTS "oracle_asset_id" text;
2
2
  --> statement-breakpoint
3
3
  UPDATE "payment_methods" SET "oracle_asset_id" = 'bitcoin' WHERE "token" = 'BTC';
4
4
  --> statement-breakpoint
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wopr-network/platform-core",
3
- "version": "1.66.0",
3
+ "version": "1.66.1",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",