Skip to content

Commit 0b1d6e3

Browse files
committed
Update Readme
1 parent f3d3296 commit 0b1d6e3

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

README.md

+27-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,30 @@ eoslime.js
77
EOS development and deployment framework based on eosjs.js. The framework's main purpose is to make the process of unit testing, deployment and compilation much simpler and much easier.
88

99
Telegram - https://t.me/eoslime
10-
Documentation - https://lyubo.gitbook.io/eoslime/
10+
Documentation - https://lyubo.gitbook.io/eoslime/
11+
12+
# Version 1.0.1 change log
13+
14+
* **Token** option was added
15+
There are cases, where you need to execute a contract function and pay some tokens, but this could be done by processing two transactions. The first one is to your contract, the second one is to eosio.token contract. But what about if the tokens transfer reverts and the transaction to your contract is successful. That is what payable contract actions are purposed for. You should be able to execute an atomic transaction constructed by both actions above.
16+
```javascript
17+
// Local network initialization
18+
const eoslime = require('eoslime').init();
19+
20+
const CONTRACT_NAME = 'mycontract';
21+
const ABI_PATH = './contract/contract.abi';
22+
23+
// Pre-created local network accounts
24+
const user1 = eoslime.Account.load('myacc1', 'privateKey1');
25+
26+
let contract = eoslime.Contract.at(ABI_PATH, CONTRACT_NAME, user1);
27+
28+
// Execute `doSmth` and transfer 5.0000 SYS tokens to the contract at once(atomically)
29+
await contract.doSmth('Your args here', { from: user1, tokens: '5.0000 SYS' });
30+
```
31+
32+
* **Scope** was added to the table query chain
33+
If you skip scope, the default one will be set to the from
34+
```javascript
35+
await Provider.select('table').from('contract name').scope('account name').find()
36+
```

0 commit comments

Comments
 (0)