Skip to content

Commit 429f100

Browse files
committed
Added transaction generator for placeAlgo and scoping out set up step
1 parent b677aad commit 429f100

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

lib/order/__tests__/GenerateTransactionTypes.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const makePlaceAssetTxns = require('../txns/sell/makePlaceAssetTxns');
2+
const makePlaceAlgoTxns = require('../txns/buy/makePlaceAlgoTxns');
23
const compile = require('../compile/compile');
34
const AlgodexApi = require('../../AlgodexApi');
45

@@ -46,6 +47,23 @@ const TransactionGenerator = {
4647
})
4748
);
4849
},
50+
getPlaceAlgoEscrowOrderTxns: async function (order, optIn) {
51+
return await makePlaceAlgoTxns(
52+
await compile({
53+
...order,
54+
appId:
55+
typeof order.appId === 'undefined'
56+
? await algodexApi.getAppId(order)
57+
: order.appId,
58+
version: 6,
59+
indexer: algodexApi.indexer,
60+
wallet: {
61+
...order.wallet,
62+
...(await algodexApi.http.indexer.fetchAccountInfo(order.wallet)),
63+
},
64+
})
65+
);
66+
},
4967
};
5068

5169
module.exports = TransactionGenerator;

lib/order/__tests__/TealAsaEscrowPlace.spec.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const connector = require('../../wallet/connectors/AlgoSDK');
1010
const placeASAOrderTest = require('./teal_tests/placeASAEscrowOrder.js');
1111
// const closeASAOrderTest = require('./teal_tests/closeASAEscrowOrder.js');
1212
const constants = require('./constants.js');
13+
const beforeAll = require('./beforeAll.js');
1314
const JEST_MINUTE_TIMEOUT = 60 * 1000;
1415

1516
const config = {
@@ -58,6 +59,9 @@ const textEncoder = new TextEncoder();
5859
//
5960
//
6061
describe('ASA ESCROW ORDER BOOK', () => {
62+
beforeAll(async () => {
63+
// setup step: Send target asset from open account to creator account
64+
});
6165
// test(
6266
// 'Create asa escrow order book',
6367
// async () => {

0 commit comments

Comments
 (0)