chore: bump SDK to v31.1.0-beta.8 - #370
Conversation
Pulls in Ethereum wallet signing and EVM address mapping, wider staking coverage (era progress, historical era reads, validator set, chill, rebond, total issuance), issuing NFTs directly to an Account, ordering POLYX transaction history, an optional middleware API key, transaction broadcast/watch with submission timeouts, and connecting from runtimes that disallow WASM compilation. Also fixes several bugs: BigNumber.isBigNumber checks across duplicate package copies, includeExpired being silently ignored on Authorizations.getReceived, a POLYX transaction count of NaN, on-chain failure reasons collapsing to "Unknown error", staking's totalStaked being off by 1e6, staking actions applying permission checks the chain doesn't make, withdraw failing when the controller isn't the stash, and DividendDistribution.claim() rejecting a genuine participant when the signing Identity is resolved from a shared Context - the exact pattern this REST API uses. No breaking changes: tsc, lint and the full test suite pass unchanged.
NftCollection.issue now accepts an optional account, mirroring the account option FungibleAsset.issue already offers on IssueDto. Omitted, the NFT is issued to the signer's default portfolio as before.
middlewareV2 always connected with key: '', with no way to supply one - POLYMESH_MIDDLEWARE_API_KEY only ever wired into the deprecated middleware (V1) config. Adds POLYMESH_MIDDLEWARE_V2_API_KEY, and stops hardcoding an empty key: the SDK now omits the x-api-key header entirely when none is given, rather than sending it empty.
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
|
|
/fast-forward |
|
🎉 This PR is included in version 9.0.0-alpha.2 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |



Summary
Bumps
@polymeshassociation/polymesh-sdkto31.1.0-beta.8and wires up the REST-visible additions from its changelog.chore: bump SDK to v31.1.0-beta.8— no breaking changes,tsc/lint/tests pass unchangedfeat: issue NFTs directly to an Account—IssueNftDtonow accepts an optionalaccount, mirroring the existingIssueDto.accounton fungible asset issuancefix: support an API key for the middleware V2 connection—middlewareV2previously always connected withkey: ''with no way to supply a real one; addsPOLYMESH_MIDDLEWARE_V2_API_KEYand stops hardcoding an empty key (the SDK now omits thex-api-keyheader entirely when none is given)Also fixed for free by the SDK bump (verified, no REST code needed)
Authorizations.getReceived({ includeExpired: true })— REST's DTO already defaults and documentstrue; the SDK was silently ignoring it and now actually honors itDividendDistribution.claim()wrongly resolving the signing Identity from a sharedContextinstead of the Procedure's own — the changelog calls this REST API out by name as the case it was breakingBigNumber.isBigNumberfixes acrossportfolio.delete,redeemTokens,redeemNft,modifyAsset,moveFunds, and other REST-exposed callsTransactionStatus.InBlockevent — both flow through REST's existing generic error/webhook handling with no gapsOut of scope (by request)
Ethereum wallet signing, EVM address mapping, and the new staking module (staking has no REST coverage today - this would be a sizeable net-new module).
Also left out as net-new features rather than fixes, to keep this PR to just the changelog's actual REST-visible deltas: a POLYX transaction history endpoint (doesn't exist in REST today), NFT
batchIssue, andbroadcast()/watch()/submission-timeout support.Verification
npx tsc --noEmit— cleanyarn lint— cleannpx prettier --check— cleanyarn test— 103/103 suites, 1073/1073 tests passing🤖 Generated with Claude Code