# Developing with CLI Wallet code

**URL:** <https://forum.safex.org/t/developing-with-cli-wallet-code/7717>\
**Category:** Other Topics\
**Created:** [April 17, 2021, 12:31am UTC](https://forum.safex.org/t/developing-with-cli-wallet-code/7717 "2021-04-17T00:31:48Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![THINKER](https://forum.safex.org/user_avatar/forum.safex.org/thinker/32/3618_2.png) [@THINKER](https://forum.safex.org/u/THINKER)\
**Post date:** [April 17, 2021, 12:31am UTC](https://forum.safex.org/t/developing-with-cli-wallet-code/7717/1 "2021-04-17T00:31:48Z")

</div>

I’m looking to use the CLI wallet code to develop something along the lines of an app, or perhaps just some interesting ways to interface with the blockchain to read data. (Mostly for experience initially, but with business users as my focus.)

I’d like to know if others can share some simple ideas they think would be useful, and maybe things to know about developing using the CLI.

I have good enough javascript skills, plus some general other languages, but not an expert by any standard. Though I’ve developed commercial software using other languages so I understand the end to end life cycle and need for continuous improvement and development, security, privacy, maintenance and such.

That said, I would like to hear from the community about how to built something new with the CLI code that would not complete the TWM, but offer some niche use cases.

Some ideas I want to experiment with:  
Make a simple basic personal store app that lets you favorite products, watch/alert an item price, quantity, etc.  
And hopefully if it ends up being safe enough, others could clone the project. (Not trying for any payment activity yet, just an anonymous product viewer similar to safex.ninja but for a single seller, or maybe even a user can favorites several sellers along with products, etc…)(i guess that’s really more like saved search queries with ability to hide results you don’t want to see again.)

If anyone has any cool use cases they want to share, I’d like to try to make something and share it.

---

<div class="post-metadata">

**Author:** ![dandabek](https://forum.safex.org/user_avatar/forum.safex.org/dandabek/32/268_2.png) [@dandabek](https://forum.safex.org/u/dandabek)\
**Post date:** [April 17, 2021, 5:32am UTC](https://forum.safex.org/t/developing-with-cli-wallet-code/7717/3 "2021-04-17T05:32:55Z")

</div>

At first glance you can find some lower level access to information directly from a full node using these rpc calls:

- [get\_staked\_tokens](https://github.com/VanGrx/safexcore/wiki/Daemon-RPC#get_staked_tokens)
- [get\_interest\_map](https://github.com/VanGrx/safexcore/wiki/Daemon-RPC#get_interest_map)
- [get\_network\_fee](https://github.com/VanGrx/safexcore/wiki/Daemon-RPC#get_network_fee)
- [get\_safex\_account\_info](https://github.com/VanGrx/safexcore/wiki/Daemon-RPC#get_safex_account_info)
- [get\_safex\_accounts](https://github.com/VanGrx/safexcore/wiki/Daemon-RPC#get_safex_accounts)
- [get\_safex\_offers](https://github.com/VanGrx/safexcore/wiki/Daemon-RPC#get_safex_offers)
- [get\_safex\_ratings](https://github.com/VanGrx/safexcore/wiki/Daemon-RPC#get_safex_ratings)
- [get\_safex\_price\_pegs](https://github.com/VanGrx/safexcore/wiki/Daemon-RPC#get_safex_price_pegs)

Found at the recent documentation, soon will be published on the main repo

> **[VanGrx/safexcore](https://github.com/VanGrx/safexcore/wiki/Daemon-RPC)**
>
> Daemon-RPC

examples here:

> <https://github.com/safex/twmwallet/blob/master/src/utils/safexd_calls.js>

For the wallet level functionality you can import safex-nodejs-libwallet

> **[safex/safex-nodejs-libwallet](https://github.com/safex/safex-nodejs-libwallet)**
>
> Node.js addon for Safex based on Monero libwallet from Exantech

This will let you open a wallet keys file and do transactions with javascript, programmatically:

> <https://github.com/safex/twmwallet/blob/master/src/utils/wallet_actions.js>

---

<div class="post-metadata">

**Author:** ![THINKER](https://forum.safex.org/user_avatar/forum.safex.org/thinker/32/3618_2.png) [@THINKER](https://forum.safex.org/u/THINKER)\
**Post date:** [June 10, 2021, 6:11pm UTC](https://forum.safex.org/t/developing-with-cli-wallet-code/7717/4 "2021-06-10T18:11:14Z")

</div>

So, I finally got some time to sit and read through all of this and use the API and I was successful in pulling in some blockchain offers header information and locked in tokens. I’ve used Microsoft Access for this so far. (Some may cringe, but I have 20+ years developing in access and can bend it to my will, it’s very extensible)

I think that’s a good start but now I’m really looking forward to doing more and seeing if I can dabble into some of the more advanced features ( create accounts, offers, stake, unstake, send tokens).i hope that’s available to do now. If anyone knows otherwise, let me know.

I’m going to import the wallet library and see what i can do next.

Thank you @dandabek for all those links, they made it easy to get to this point and I hope to be a contributor in the near future.

After I get successful testing I hope to be able to share a template of what I’ve built, it will have some really interesting features.

---

<div class="post-metadata">

**Author:** ![dandabek](https://forum.safex.org/user_avatar/forum.safex.org/dandabek/32/268_2.png) [@dandabek](https://forum.safex.org/u/dandabek)\
**Post date:** [June 10, 2021, 6:32pm UTC](https://forum.safex.org/t/developing-with-cli-wallet-code/7717/5 "2021-06-10T18:32:21Z")

</div>

Thanks @THINKER for sharing your experience up to now, maybe share with us a screenshot if you have of what can be seen from your side 🤓

Probably among the best thread replies so far! 🙂

---

<div class="post-metadata">

**Author:** ![lecodo4776](https://forum.safex.org/user_avatar/forum.safex.org/lecodo4776/32/3384_2.png) [@lecodo4776](https://forum.safex.org/u/lecodo4776)\
**Post date:** [June 10, 2021, 6:54pm UTC](https://forum.safex.org/t/developing-with-cli-wallet-code/7717/6 "2021-06-10T18:54:11Z")

</div>

Brilliant to see someone having a tinker with what is available. Wish I had to knowledge to help or do something productive.

---

<div class="post-metadata">

**Author:** ![Turbobrian](https://forum.safex.org/user_avatar/forum.safex.org/turbobrian/32/1862_2.png) [@Turbobrian](https://forum.safex.org/u/Turbobrian)\
**Post date:** [June 12, 2021, 7:37pm UTC](https://forum.safex.org/t/developing-with-cli-wallet-code/7717/8 "2021-06-12T19:37:42Z")

</div>

When someone develops a phone app that works it will advance the marketplace 5 years instantly. Can’t wait to see it!

---

<div class="post-metadata">

**Author:** ![dandabek](https://forum.safex.org/user_avatar/forum.safex.org/dandabek/32/268_2.png) [@dandabek](https://forum.safex.org/u/dandabek)\
**Post date:** [June 13, 2021, 2:08am UTC](https://forum.safex.org/t/developing-with-cli-wallet-code/7717/9 "2021-06-13T02:08:21Z")

</div>

I agree with you 100%, I hope over the summer we result in a mobile wallet with marketplace access.

---

<div class="post-metadata">

**Author:** ![THINKER](https://forum.safex.org/user_avatar/forum.safex.org/thinker/32/3618_2.png) [@THINKER](https://forum.safex.org/u/THINKER)\
**Post date:** [June 22, 2021, 10:49pm UTC](https://forum.safex.org/t/developing-with-cli-wallet-code/7717/10 "2021-06-22T22:49:07Z")

</div>

@dandabek here are some samples:  
Pulling in price pegs and being able to ‘favorite’ your preferred peg

 ![image](https://forum.safex.org/uploads/default/original/2X/4/4ce353194e31179b6802d1f61901e690ad151d20.png)

Filtering Price Pegs (for future use case)

 ![image](https://forum.safex.org/uploads/default/original/2X/d/d5918f47357b9c36bd4428e9dae658a86a027994.png)

Showing the Blockchain stats:

 ![image](https://forum.safex.org/uploads/default/original/2X/3/3d84d169eb6c287ec0131b9775d356b34f71913f.png)

This auto refreshes based on your set timer: (every 2 minutes here):

 ![image](https://forum.safex.org/uploads/default/original/2X/2/2f29a19424c491d5a3f5445dc90f1604331dda57.png)

So far this has been simple…about 8 hours invested  
Now I can attack more adventurous things!!

---

<div class="post-metadata">

**Author:** ![THINKER](https://forum.safex.org/user_avatar/forum.safex.org/thinker/32/3618_2.png) [@THINKER](https://forum.safex.org/u/THINKER)\
**Post date:** [June 23, 2021, 7:12pm UTC](https://forum.safex.org/t/developing-with-cli-wallet-code/7717/11 "2021-06-23T19:12:28Z")

</div>

I got offers imported…just a little more data transformation work needed to get it all converted correct…but this means next stop is wallet tools!

(got the offers! - now to learn how to go make them!! 😉 )

 ![image](https://forum.safex.org/uploads/default/original/2X/c/c577e1f35b048779a395f77ccb520443aa82e606.png)

(the layout has not been edited et…lots of prettying up to do still)

 ![image](https://forum.safex.org/uploads/default/original/2X/2/2c2000e846ba829f2a6d5fc960e4aa005a46c075.jpeg)

Wallet library might be a steeper learning curve, so I’ll take my time learning that and share later

---

<div class="post-metadata">

**Author:** ![THINKER](https://forum.safex.org/user_avatar/forum.safex.org/thinker/32/3618_2.png) [@THINKER](https://forum.safex.org/u/THINKER)\
**Post date:** [August 21, 2021, 2:26pm UTC](https://forum.safex.org/t/developing-with-cli-wallet-code/7717/12 "2021-08-21T14:26:14Z")

</div>

just an update, I’ve made it a lot further and have the RPC wallet functionality working very well.  
I can open/close wallet, tag/untag, label account, plus the code is set up for the other general wallet functions.

I’ve turned my focus back to the safex account creating and offer generation, though I’m a bit stuck on this.

If anyone has any tips to share, please do.

When using the CLI Wallet command ‘ **safex\_account** ’  
_example:_  
`safex_account new testusername1 sample account data`

The new safex\_account appear in my list of safex\_accounts, but status says active: no.

The documentation for “Account Creation” ([Advanced transactions · VanGrx/safexcore Wiki · GitHub](https://github.com/VanGrx/safexcore/wiki/Advanced-transactions#acc_creation)) says to lock 1000 SFT, but the command does not have a parameter for it.

**Is the locking of 1000 SFT a sperate step? or how do you lock the SFT to have an account created?**

 ![image](https://forum.safex.org/uploads/default/original/2X/1/192ab748ab919191d1e7dbb52209e71476a8f6bd.png)

I have created a couple test accounts, and all say **active: no**

 ![image](https://forum.safex.org/uploads/default/original/2X/8/8a7e94d2a8cbb71b8ae895f91ce213435fad8d23.png)

Can anyone point me to what I might be missing?  
Thank you in advance!

---

<div class="post-metadata">

**Author:** ![Lomax](https://forum.safex.org/user_avatar/forum.safex.org/lomax/32/3205_2.png) [@Lomax](https://forum.safex.org/u/Lomax)\
**Post date:** [August 21, 2021, 5:15pm UTC](https://forum.safex.org/t/developing-with-cli-wallet-code/7717/13 "2021-08-21T17:15:48Z")

</div>

You first do the new account like you did to create new account on the wallet, and then safex\_account _create_ (name) to create it on the blockchain, then when txn is send it will mature for 10 blocks and then the account is active

---

<div class="post-metadata">

**Author:** ![aussiesloth](https://forum.safex.org/user_avatar/forum.safex.org/aussiesloth/32/2080_2.png) [@aussiesloth](https://forum.safex.org/u/aussiesloth)\
**Post date:** [August 21, 2021, 9:39pm UTC](https://forum.safex.org/t/developing-with-cli-wallet-code/7717/14 "2021-08-21T21:39:47Z")

</div>

What @Lomax said 👌👆

---

<div class="post-metadata">

**Author:** ![THINKER](https://forum.safex.org/user_avatar/forum.safex.org/thinker/32/3618_2.png) [@THINKER](https://forum.safex.org/u/THINKER)\
**Post date:** [August 21, 2021, 11:46pm UTC](https://forum.safex.org/t/developing-with-cli-wallet-code/7717/15 "2021-08-21T23:46:15Z")

</div>

@Lomax Well that was simple. Thank you…transaction sent. Now I try to bring this closer to the finish line.

---

<div class="post-metadata">

**Author:** ![THINKER](https://forum.safex.org/user_avatar/forum.safex.org/thinker/32/3618_2.png) [@THINKER](https://forum.safex.org/u/THINKER)\
**Post date:** [August 25, 2021, 7:58pm UTC](https://forum.safex.org/t/developing-with-cli-wallet-code/7717/16 "2021-08-25T19:58:24Z")

</div>

So after a safex\_account is created, attempting to “safex\_offer new” or “safex\_account edit” I get:  
Error: internal error: the tx uses funds from multiple accounts  
 ![image](https://forum.safex.org/uploads/default/original/2X/2/21380daa0cf6a7436bd228a81fab6a83507386bf.png)

Not sure I understand how it’s selecting funds from multiple accounts. Wondering if it’s something different? I’m running the command on the selected account (index of 1 in this case) and it has funds.

 ![image](https://forum.safex.org/uploads/default/original/2X/0/094ba6a06b40e2cf4ca1582c855b5e42b65d2486.png)

Does anyone know how to force this to use just a single account for the funds?  
Or do I need to do something like send myself a big block of SFX/SFT?

---

<div class="post-metadata">

**Author:** ![aussiesloth](https://forum.safex.org/user_avatar/forum.safex.org/aussiesloth/32/2080_2.png) [@aussiesloth](https://forum.safex.org/u/aussiesloth)\
**Post date:** [August 25, 2021, 8:31pm UTC](https://forum.safex.org/t/developing-with-cli-wallet-code/7717/17 "2021-08-25T20:31:05Z")

</div>

I’m honestly not sure you can use the advanced functions outside of the index 0 account. The testing was never focussed on using the subaccounts.

---

<div class="post-metadata">

**Author:** ![aussiesloth](https://forum.safex.org/user_avatar/forum.safex.org/aussiesloth/32/2080_2.png) [@aussiesloth](https://forum.safex.org/u/aussiesloth)\
**Post date:** [August 25, 2021, 8:32pm UTC](https://forum.safex.org/t/developing-with-cli-wallet-code/7717/18 "2021-08-25T20:32:06Z")

</div>

I’d recommend moving the coins back to the main account (index 0) and trying there.

---

<div class="post-metadata">

**Author:** ![THINKER](https://forum.safex.org/user_avatar/forum.safex.org/thinker/32/3618_2.png) [@THINKER](https://forum.safex.org/u/THINKER)\
**Post date:** [August 25, 2021, 8:34pm UTC](https://forum.safex.org/t/developing-with-cli-wallet-code/7717/19 "2021-08-25T20:34:29Z")

</div>

Just a peek at some rough work.  
Desktop browser with some different view options for product images. Plus working on these features:

- ability to favorite/unfavorite an item.
- ability to show/hide by product (always show, never show, hide until updated)
- ability to show/hide by seller (always show, never show, hide until new products)
- ability to search local (coming soon)
- ability to create custom search query
- ability to save a search query
- ability to be alerted when something new matches your search query

 ![image](https://forum.safex.org/uploads/default/original/2X/1/12cd5d98c059abc3ea3f209a1b6c81c317ac2a00.jpeg)

 ![image](https://forum.safex.org/uploads/default/original/2X/9/9f8a68e4efa8503df7d0820bdaa14a6dcef59879.jpeg)

---

<div class="post-metadata">

**Author:** ![THINKER](https://forum.safex.org/user_avatar/forum.safex.org/thinker/32/3618_2.png) [@THINKER](https://forum.safex.org/u/THINKER)\
**Post date:** [August 25, 2021, 8:35pm UTC](https://forum.safex.org/t/developing-with-cli-wallet-code/7717/20 "2021-08-25T20:35:12Z")

</div>

well It seems I color outside the lines…I’ll move things to account 0 and try again.  
Thanks

---

<div class="post-metadata">

**Author:** ![aussiesloth](https://forum.safex.org/user_avatar/forum.safex.org/aussiesloth/32/2080_2.png) [@aussiesloth](https://forum.safex.org/u/aussiesloth)\
**Post date:** [August 25, 2021, 8:35pm UTC](https://forum.safex.org/t/developing-with-cli-wallet-code/7717/21 "2021-08-25T20:35:50Z")

</div>

No worries. Which index # did you use to create the safex\_account?

---

<div class="post-metadata">

**Author:** ![THINKER](https://forum.safex.org/user_avatar/forum.safex.org/thinker/32/3618_2.png) [@THINKER](https://forum.safex.org/u/THINKER)\
**Post date:** [August 25, 2021, 8:36pm UTC](https://forum.safex.org/t/developing-with-cli-wallet-code/7717/22 "2021-08-25T20:36:29Z")

</div>

I used account index 1 to create the safex\_account

[Next page](https://forum.safex.org/t/developing-with-cli-wallet-code/7717.md?page=2)
