Secret Network Gets a Secret API!

Secret Network
October 6, 2020
Twitter
LinkedIn

⚠️ Disclaimer: This API is no longer operational, check out our API registry for available APIs, faucets, and more.


Eureka! There’s gold in them thar hills! Secret gold 🤫 🌄 ⛏️

Chain of Secrets has launched the Secret API for Secret Network as part of our developer on-boarding efforts.

On September 15th, 2020, Enigma and the Secret Community brought Secret Contracts live to mainnet in a groundbreaking event we called the Vulcan upgrade:

“This mainnet upgrade makes Secret Network the only blockchain running live smart contracts with encrypted inputs, outputs, and state.”

Upgrade Complete: Secret Contracts are LIVE on Mainnet!
The secret is out! Privacy-preserving smart contracts are now LIVE on Secret Network. Learn about this launch, our exciting initial apps, our new strategic partnership with Hashed, and what comes next as “programmable privacy” comes to public blockchains.

It’s time to start panning for secret gold!

Now that Secret Contracts are LIVE, we can build some great Secret Apps together. Secret API supports querying the state of the network, submitting governance proposals and voting, withdrawing staking rewards, querying and broadcasting transactions, and much more.

We’re working on adding the latest secret contract queries and transactions for the compute module and the experimental secret20 commands to the Secret API. Stay tuned!

Secret API provides an interface with both REST and RPC endpoints, which all kinds of Secret Agents may use to interact with the network. It’s a great way to get familiar with the different things you can do, and we provide helpful examples with parameter settings and typical responses.

  • Swagger UI — web interface
  • REST endpoint —  supports queries and transactions against the network
  • RPC endpoint  —  where you can get information on network peers, dump the consensus state of the chain, and get the genesis state

Secret API ~ Web Interface

Located at secretapi.io 🙂

Using the interface, you can click one of the items and try it out. For example, if you wanted to see all the validators that a delegator has staked with, you would click on the GET /staking/delegators/{delegatorAddr}/validators item.

If you click Try it out, enter a delegator address, and then hit Execute, you will see the JSON response, and you can download the data. Pretty cool!

Secret API ~ REST Service

A service using representational state transfer (REST) can be accessed directly at https://api.secretapi.io and/or by adding paths and parameters to the URL.

Example: https://api.secretapi.io/blocks/latest

Secret API ~ RPC Service

The RPC service can be accessed at https://rpc.secretapi.io and/or by adding the parameters and JSON where necessary. If you go to the URL, it will show a list of endpoints and the applicable parameters:

Well, that’s our Secret API in a nutshell! Or should we say nugget?

Have fun trying it out and let us know what you’re building! ⚒️

Here’s another secret “gold nugget” that nicely ties into our Secret API! SecretJS is a Typescript client for building Secret Apps, and it has methods for interacting with secret contracts. You can read more about building Secret Apps with SecretJS, and try using a functional “Secret Voting” app here:

How To Build Secret Apps: An Evolving Development Guide
This walkthrough includes a tutorial for deploying and instantiating your first Secret Contract, along with a demo application, Secret Voting!

We also have a freshly-generated Python SDK you can try!

Let us know if you have any feedback or questions. If you’d like to support our mission of driving adoption of Secret Network and bringing more Secret Apps to the world, consider delegating to us!

Delegate to CoS: https://chainofsecrets.org/delegate.html

Chain of Secrets is a Secret Network validator node and a key contributor to the Secret Network ecosystem.

Telegram: https://t.me/chainofsecrets

Twitter: https://twitter.com/cosorg

Web: https://chainofsecrets.org

art by Laura Weindorf of CoS!

To discuss Secret Network and Secret Apps, visit our community channels:
Website | Forum | Twitter | Discord | Telegram