diff --git a/package.json b/package.json index 8e5a2ea..fe5ee85 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "crypto-coin-kit", - "version": "0.2.31", + "version": "0.2.32", "description": "crypto coin kit for common coins", "main": "./dist/index.js", "scripts": { diff --git a/src/DOT/index.ts b/src/DOT/index.ts index 3d8ef1c..d6d24f6 100644 --- a/src/DOT/index.ts +++ b/src/DOT/index.ts @@ -210,6 +210,7 @@ export class DOT implements Coin { specVersion: new BN(data.specVersion), transactionVersion: new BN(data.transactionVersion), }, + tip: data.tip || 0, }, ); const signedTx = signed.toHex(); diff --git a/src/__tests__/coins/DOT.test.ts b/src/__tests__/coins/DOT.test.ts index 91e340a..33308f8 100644 --- a/src/__tests__/coins/DOT.test.ts +++ b/src/__tests__/coins/DOT.test.ts @@ -94,6 +94,29 @@ describe('coins.DOT', () => { expect(reg.test(result.txHex)).toBe(true); }); + it('should generate transaction with tip', () => { + const keyProviderSync = sr25519KeyProviderSync(privateKey, publicKey); + const txData = { + value: 100000000000, + dest: '5DUmuykcaNu6bVE9R7Ya25oPMw3GkYjYLM2P9b5L1FdoB7kf', + blockHash: + '0xe143f23803ac50e8f6f8e62695d1ce9e4e1d68aa36c1cd2cfd15340213f3423e', + tip: 9000000000, + nonce: 3, + implVersion: 0, + authoringVersion: 2, + specVersion: 41, + transactionVersion: 2, + metaData: westend, + blockNumber: 0, + }; + const result = wnd.generateTransactionSync(txData, keyProviderSync); + const reg = new RegExp( + '0x4902848cba3d59242abc565c99a47c3afaf23668f2e1b1a76a38ab71868ae2dafca96301([a-f0-9]+)000c07001a71180204003e97c7cee955a5f2ab3f9346ed85bf2c1b16fcc1afae3e40942bbab648a036040700e8764817', + ); + expect(reg.test(result.txHex)).toBe(true); + }); + it('should generate dot transaction', () => { //https://polkascan.io/polkadot/event/1515777-2 const keyProviderSync = sr25519KeyProviderSync(privateKey, publicKey);