-
Notifications
You must be signed in to change notification settings - Fork 277
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(sdk-coin-oas): add oas sdk skeleton
Ticket: WIN-3696
- Loading branch information
Showing
3 changed files
with
39 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 32 additions & 15 deletions
47
modules/sdk-coin-oas/test/unit/transactionBuilder/send.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,33 @@ | ||
import { getBuilder } from '../getBuilder'; | ||
import should from 'should'; | ||
// import { getBuilder } from '../getBuilder'; | ||
// import should from 'should'; | ||
// import * as testData from '../../resources/oas'; | ||
|
||
describe('OAS Transfer Builder', () => { | ||
describe('Build from TxHex', function () { | ||
it('Should successfully build from txHex', async function () { | ||
const txBuilder = getBuilder('toas'); | ||
const txHex = | ||
'0xf9018e018541314cf000836acfc0948ce59c2d1702844f8eded451aa103961bc37b4e880b9016439125215000000000000000000000000eeaf0f05f37891ab4a21208b105a0687d12c5af7000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000002710000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004105d7520d2834b2e789206d4b016346247147838c32bd8dc12cf189d296a5e66219daf603c940897d2eb847dcd3bdb261cdc287596e757e16736711a7cd23f94f1b00000000000000000000000000000000000000000000000000000000000000830271cb8080'; | ||
txBuilder.from(txHex); | ||
const parsedTx = await txBuilder.build(); | ||
|
||
should.exist(parsedTx.toJson()); | ||
}); | ||
}); | ||
}); | ||
// describe('OAS Transfer Builder', () => { | ||
// describe('Build from TxHex', function () { | ||
// it('Should successfully build from txHex', async function () { | ||
// const txBuilder = getBuilder('toas'); | ||
// const privatekey = "ABAF3CD623F5353A143AB5E2EF47CEBD94877460D3C6F5A273313DE98F96DBBC"; | ||
// const recipient = '0x19645032c7f1533395d44a629462e751084d3e4c'; | ||
// const amount = '1000000000'; | ||
// const expireToime = 1590066728; | ||
// const sequenceId = 5; | ||
// const key = testData.KEYPAIR_PRV.getKeys().prv as string; | ||
// txBuilder.fee({ | ||
// fee: '1000000000', | ||
// gasLimit: '12100000', | ||
// }); | ||
// txBuilder | ||
// .transfer() | ||
// .amount(amount) | ||
// .to(recipient) | ||
// .expirationTime(expireTime) | ||
// .contractSequenceId(sequenceId) | ||
// .key(key); | ||
// | ||
// txBuilder.sign({ key: privatekey }); | ||
// | ||
// const tx = await txBuilder.build(); | ||
// | ||
// }); | ||
// }); | ||
// }); |