Skip to content

Add TS script to read and process broadcastable messages from JSON in examples/ts #6891

@bhavidhingra

Description

@bhavidhingra

Feature Description

Create a TypeScript script in the examples/ts folder that reads a JSON file containing an array of claims, each with a broadcastableMessage string. The script should:

  • Parse the JSON structure as provided.
  • Extract the broadcastableMessage fields from each claim.
  • Use deserializeBIP322BroadcastableMessage() to deserialize each message.
  • Pass the deserialized message to generateBIP322MessageListAndVerifyFromMessageBroadcastable().
  • Print or log the results.

Motivation

This will provide a clear usage example for handling BIP322 broadcastable messages with the relevant BitGo utilities. It will help developers understand how to process airdrop claim data and verify messages in a production-like scenario.

Context

Sample JSON structure:

{
  "status": "success",
  "claims": [
    {
      "id": "...",
      ...
      "broadcastableMessage": "...",
      ...
    }
  ],
  "count": 1,
  "pagination": {
    "limit": 100,
    "hasNext": false
  }
}

The script should be added to examples/ts/. Functions to use: deserializeBIP322BroadcastableMessage, generateBIP322MessageListAndVerifyFromMessageBroadcastable.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions