hashgraph / hashgraph/asset-tokenization-studio

SDK's Network.connect has no headless/private-key signing option

Open
#1,397 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
33
Forks
28
Avg merge
15h 36m
Merged PRs (30d)
8

Description

### Summary

`@hashgraph/asset-tokenization-sdk`'s `ConnectRequest.wallet` field only
accepts `SupportedWallets.{METAMASK, HWALLETCONNECT, DFNS, FIREBLOCKS, AWSKMS}`
(confirmed from the installed package's own `ConnectRequest.d.ts`, v8.0.0).
There doesn't appear to be a way to drive the SDK from a plain Node.js
script using a raw Hedera operator private key — every option needs
either a browser wallet extension, an interactive WalletConnect pairing,
or an enterprise custodial KMS account already set up.

### Why this is surprising

`packages/ats/sdk/__tests__/config.ts` in this repo constructs an
`Account` directly from a raw ECDSA `PrivateKey`:

```ts
export const CLIENT_PRIVATE_KEY_ECDSA = new PrivateKey({
key: process.env.CLIENT_PRIVATE_KEY_ECDSA_1 ?? "",
type: "ECDSA",
});
// ...
export const CLIENT_ACCOUNT_ECDSA: Account = new Account({
id: CLIENT_ACCOUNT_ID_ECDSA,
evmAddress: CLIENT_EVM_ADDRESS_ECDSA_1,
privateKey: CLIENT_PRIVATE_KEY_ECDSA,
publicKey: CLIENT_PUBLIC_KEY_ECDSA,
});
```

This pattern is clearly used internally by the SDK's own integration test
fixtures, but it isn't exposed as a supported `Network.connect` path for
consumers. For anyone building a deploy script, indexer, keeper bot, or
CI job that needs to issue/manage securities without a browser in the
loop, this is a dead end as far as the public SDK surface goes.

### Suggested fix (either would help)

1. **Document it explicitly** — a line in the SDK README's "Connect an
account to the SDK" section stating that headless/backend usage isn't
currently supported by the public API would have saved real
integration time.
2. **Or expose the raw-key path** — since the underlying capability
clearly exists (the test fixtures use it), surfacing it as a real
`SupportedWallets` option (e.g. `SupportedWallets.PRIVATE_KEY` /
`SupportedWallets.OPERATOR_KEY`) would let backend integrators use the
SDK the way its own tests already do.

### What we did instead

Called the ATS diamond contracts directly via
`@hashgraph/asset-tokenization-contracts`'s shipped
`deployEquityFromFactory` helper and generated typechain types, driven by
a plain `ethers.Wallet`. Worked well, but required reading source to
discover — the SDK's advertised path didn't get us there. Full writeup:
https://github.com/fabian4819/Stratus-Finance/blob/main/docs/phase-0-findings.md

### Environment

- `@hashgraph/asset-tokenization-sdk` v8.0.0
- `@hashgraph/asset-tokenization-contracts` v8.0.0
- Node.js v22

Contributor guide

Open the contributing guide

Research direction

Start at the public Network.connect entry point and the installed ConnectRequest.d.ts, then compare the available wallet options with packages/ats/sdk/__tests__/config.ts. Review the SDK README's “Connect an account to the SDK” section and the linked findings for context. Done means the chosen scope is resolved: either headless support is exposed consistently or its lack is explicitly documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.