Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions modules/sdk-coin-dot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"@bitgo/sdk-core": "^36.33.2",
"@bitgo/sdk-lib-mpc": "^10.9.0",
"@bitgo/statics": "^58.29.0",
"@bitgo/wasm-dot": "^1.1.2",
"@polkadot/api": "14.1.1",
"@polkadot/api-augment": "14.1.1",
"@polkadot/keyring": "13.5.6",
Expand Down
8 changes: 0 additions & 8 deletions modules/sdk-coin-dot/src/dot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,6 @@ export interface TransactionPrebuild {
transaction: Interface.TxData;
}

export interface ExplainTransactionOptions {
txPrebuild: TransactionPrebuild;
publicKey: string;
feeInfo: {
fee: string;
};
}

export interface VerifiedTransactionParameters {
txHex: string;
prv: string;
Expand Down
2 changes: 2 additions & 0 deletions modules/sdk-coin-dot/src/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@ export { TransactionBuilderFactory } from './transactionBuilderFactory';
export { SingletonRegistry } from './singletonRegistry';
export { NativeTransferBuilder } from './nativeTransferBuilder';
export { RemoveProxyBuilder } from './proxyBuilder';
export { explainDotTransaction } from './wasmParser';
export type { ExplainDotTransactionParams, DotWasmExplanation, DotInput } from './wasmParser';
export { Interface, Utils };
15 changes: 15 additions & 0 deletions modules/sdk-coin-dot/src/lib/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import {
} from './iface';
import { getAddress, getDelegateAddress } from './iface_utils';
import utils from './utils';
import { toJsonFromWasm } from './wasmParser';
import BigNumber from 'bignumber.js';
import { Vec } from '@polkadot/types';
import { PalletConstantMetadataV14 } from '@polkadot/types/interfaces';
Expand Down Expand Up @@ -161,6 +162,20 @@ export class Transaction extends BaseTransaction {
if (!this._dotTransaction) {
throw new InvalidTransactionError('Empty transaction');
}

// WASM path for signed tdot transactions — validates WASM parsing against production.
// Only for signed txs because toBroadcastFormat() returns the signed extrinsic (parseable).
// Unsigned txs return a signing payload (different format), so they use the legacy path.
if (this._coinConfig.name === 'tdot' && this._signedTransaction) {
return toJsonFromWasm({
txHex: this._signedTransaction,
material: utils.getMaterial(this._coinConfig),
senderAddress: this._sender,
coinConfigName: this._coinConfig.name,
referenceBlock: this._dotTransaction.blockHash,
blockNumber: Number(this._dotTransaction.blockNumber),
});
}
const decodedTx = decode(this._dotTransaction, {
metadataRpc: this._dotTransaction.metadataRpc,
registry: this._registry,
Expand Down
Loading