@simbachain/simbats
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -228,3 +228,3 @@ "use strict"; | ||
else { | ||
config_1.SimbaConfig.log.error(`${JSON.stringify(error)}`); | ||
config_1.SimbaConfig.log.error(`${error}`); | ||
} | ||
@@ -231,0 +231,0 @@ config_1.SimbaConfig.log.debug(`:: SIMBA : EXIT :`); |
@@ -784,3 +784,3 @@ "use strict"; | ||
else { | ||
config_1.SimbaConfig.log.error(`${JSON.stringify(error)}`); | ||
config_1.SimbaConfig.log.error(`${error}`); | ||
} | ||
@@ -787,0 +787,0 @@ config_1.SimbaConfig.log.debug(`:: SIMBA : EXIT :`); |
{ | ||
"name": "@simbachain/simbats", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "TypeScript SDK for SIMBA Chain", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
249
README.md
@@ -16,5 +16,25 @@ # SimbaTS | ||
- [Simba](#simba) | ||
- [Simba Insantiation](#simba-instantation) | ||
- [Simba Wallet Methods](#simba-wallet-methods) | ||
- [Simba Org And App Methods](#simba-org-and-app-methods) | ||
- [Getting Contracts and Transactions](#getting-contracts-and-transactions) | ||
- [File (Bundle) Methods](#simba-bundle-file-methods) | ||
- [Event Methods](#event-methods) | ||
- [Getting a Transaction Receipt](#get-receipt) | ||
- [Smart Contract Methods](#simba-smart-contract-methods) | ||
- [Submitting a Signed Transaction](#submitting-a-signed-transaction) | ||
- [Saving, Getting, and Deploying Contract Designs and Artifacts](#saving-and-getting-and-deploying-contract-designs-and-artifacts) | ||
- [Method That Wait For Processes To Complete](#method-that-wait-for-processes-to-complete) | ||
- [Getting Blockchains and Storages](#getting-blockchains-and-storages) | ||
- [Subscriptions and Notifications](#subscriptions-and-notifications) | ||
- [SimbaContract](#SimbaContract) | ||
- [Instantiating SimbaContract](#instantiating-simbacontract) | ||
- [SimbaContract Smart Contract Methods](#simbacontract-smart-contract-methods) | ||
- [SimbaContract Bundle File Methods](#simbacontract-bundle-file-methods) | ||
- [SimbaSync](#SimbaSync) | ||
- [Instantiating SimbaSync](#instantiating-simbasync) | ||
- [Submitting a SimbaSync Smart Contract Method](#submitting-a-simbasync-smart-contract-method) | ||
- [SimbaContractSync](#SimbaContractSync) | ||
- [Instantiating SimbaContractSync](#instantiating-simbacontractsync) | ||
- [Submitting a SimbaContractSync Smart Contract Method](#submitting-a-simbacontractsync-smart-contract-method) | ||
5. [Integrating with Polyglot](#integrating-with-polyglot) | ||
@@ -26,3 +46,3 @@ 6. [Testing](#testing) | ||
SimbaTS is the TypeScript SDK for SIMBA Chain. It contains functionality for interacting with the SIMBA platform in general, as well as for interacting with your deployed smart contracts in particular. If you are using SimbaTS to interact with your deployed smart contracts, then we highly recommend you integrate with our Polyglot service, which we explain in this documentation. | ||
SimbaTS is the TypeScript SDK for SIMBA Chain. It contains functionality for interacting with the SIMBA platform in general, as well as for interacting with your deployed smart contracts in particular. We currently have a service, Polyglot, that is under construction, which will streamline the process of interacting with your deployed smart contracts If you are using SimbaTS to interact with your deployed smart contracts, then we highly recommend you integrate with our Polyglot service, which we explain in this documentation. | ||
@@ -39,2 +59,4 @@ ## Installation | ||
git clone https://github.com/SIMBAChain/SimbaTS.git | ||
Then you'll want to checkout the develop branch | ||
``` | ||
@@ -199,2 +221,3 @@ | ||
#### Simba Instantiation | ||
```TypeScript | ||
@@ -209,3 +232,6 @@ // instantiating Simba object | ||
const simbaContract = simba.getSimbaContract(appName, contractName); | ||
``` | ||
#### Simba Wallet Methods | ||
```TypeScript | ||
// Simba.whoAmI | ||
@@ -223,7 +249,7 @@ const simba = new Simba(); | ||
// testing Simba.balance | ||
// Simba.balance | ||
const simba = new Simba(); | ||
const balance = await simba.balance("mumbai", mumbaiWallet) as Record<any, any>; | ||
// testing Simba.adminSetWallet | ||
// Simba.adminSetWallet | ||
const simba = new Simba(); | ||
@@ -248,3 +274,6 @@ const res = await simba.adminSetWallet( | ||
const walletRes = await simba.getWallet() as Record<any, any>; | ||
``` | ||
#### Simba Org And App Methods | ||
```TypeScript | ||
// Simba.createOrg | ||
@@ -263,3 +292,2 @@ const simba = new Simba(); | ||
// Simba.getApplications | ||
@@ -273,3 +301,2 @@ const simba = new Simba(); | ||
// Simba.getApplicationTransactions | ||
@@ -279,3 +306,3 @@ const simba = new Simba(); | ||
// testing Simba.getApplicationTransactions with queryParams | ||
// Simba.getApplicationTransactions with queryParams | ||
const simba = new Simba(); | ||
@@ -291,3 +318,6 @@ const request_id = "34bb8e12-8459-43cc-ae7f-e0fe0a59fbb1"; | ||
const contract = await simba.getApplicationContract(appName, contractName) as Record<any, any>; | ||
``` | ||
#### Getting Contracts and Transactions | ||
```TypeScript | ||
// Simba.getcontractTransactions | ||
@@ -309,3 +339,3 @@ const simba = new Simba(); | ||
// testing Simba.getContracts with queryParams | ||
// Simba.getContracts with queryParams | ||
const simba = new Simba(); | ||
@@ -318,2 +348,39 @@ const id = "acf6fd5d-e27a-4493-ae79-9b73c6ddc9a4"; | ||
// Simba.getContractInfo | ||
const simba = new Simba(); | ||
const info = await simba.getContractInfo(appName, contractName) as Record<any, any>; | ||
const contract = info.contract; | ||
// Simba.getTransaction | ||
const simba = new Simba(); | ||
const res = await simba.getTransaction(appName, contractName, transactionHash) as Record<any, any>; | ||
const transaction = res.transaction; | ||
// Simba.getTransactionsByMethod | ||
const simba = new Simba(); | ||
const res = await simba.getTransactionsByMethod(appName, contractName, "structTest5") as Record<any, any>; | ||
// Simba.getTransactionsByMethod with queryParams | ||
const simba = new Simba(); | ||
const id = "5a2288c6-0562-41e8-8f63-e6820fa3e62a"; | ||
const queryParams = { | ||
id, | ||
} | ||
const res = await simba.getTransactionsByMethod(appName, contractName, "structTest5", queryParams) as Record<any, any>; | ||
// Simba.getTransactionsByContract | ||
const simba = new Simba(); | ||
const res = await simba.getTransactionsByContract(appName, contractName) as Record<any, any>; | ||
// Simba.getTransactionsByContract with queryParams | ||
const simba = new Simba(); | ||
const id = "5a2288c6-0562-41e8-8f63-e6820fa3e62a"; | ||
const queryParams = { | ||
id, | ||
} | ||
const res = await simba.getTransactionsByMethod(appName, contractName, "structTest5", queryParams) as Record<any, any>; | ||
``` | ||
#### Simba Bundle File Methods | ||
```TypeScript | ||
// Simba.validateBundleHash | ||
@@ -339,3 +406,2 @@ const simba = new Simba(); | ||
// Simba.getManifestForBundleFromBundleHash | ||
@@ -348,8 +414,6 @@ const simba = new Simba(); | ||
) as Record<any, any>; | ||
``` | ||
// Simba.getContractInfo | ||
const simba = new Simba(); | ||
const info = await simba.getContractInfo(appName, contractName) as Record<any, any>; | ||
const contract = info.contract; | ||
#### Event Methods | ||
```TypeScript | ||
// Simba.getEvents | ||
@@ -363,3 +427,3 @@ const simba = new Simba(); | ||
// testing Simba.getEvents with queryParams | ||
// Simba.getEvents with queryParams | ||
const simba = new Simba(); | ||
@@ -380,4 +444,3 @@ const queryParams = { | ||
// queryParams not currently working the way we want | ||
// testing Simba.adminGetEvents with queryParams | ||
// Simba.adminGetEvents with queryParams | ||
const simba = new Simba(); | ||
@@ -389,3 +452,6 @@ const id = "195a5391-84f4-4743-8dfe-d898309db809"; | ||
const res = await simba.adminGetEvents(queryParams) as Record<any, any>; | ||
``` | ||
#### Get Receipt | ||
```TypeScript | ||
// Simba.getReceipt | ||
@@ -395,32 +461,6 @@ const simba = new Simba(); | ||
const receipt = res.receipt; | ||
``` | ||
// Simba.getTransaction | ||
const simba = new Simba(); | ||
const res = await simba.getTransaction(appName, contractName, transactionHash) as Record<any, any>; | ||
const transaction = res.transaction; | ||
// Simba.getTransactionsByMethod | ||
const simba = new Simba(); | ||
const res = await simba.getTransactionsByMethod(appName, contractName, "structTest5") as Record<any, any>; | ||
// Simba.getTransactionsByMethod with queryParams | ||
const simba = new Simba(); | ||
const id = "5a2288c6-0562-41e8-8f63-e6820fa3e62a"; | ||
const queryParams = { | ||
id, | ||
} | ||
const res = await simba.getTransactionsByMethod(appName, contractName, "structTest5", queryParams) as Record<any, any>; | ||
// Simba.getTransactionsByContract | ||
const simba = new Simba(); | ||
const res = await simba.getTransactionsByContract(appName, contractName) as Record<any, any>; | ||
// Simba.getTransactionsByContract with queryParams | ||
const simba = new Simba(); | ||
const id = "5a2288c6-0562-41e8-8f63-e6820fa3e62a"; | ||
const queryParams = { | ||
id, | ||
} | ||
const res = await simba.getTransactionsByMethod(appName, contractName, "structTest5", queryParams) as Record<any, any>; | ||
### Simba Smart Contract Methods | ||
```TypeScript | ||
// Simba.submitContractMethod | ||
@@ -467,3 +507,2 @@ const simba = new Simba(); | ||
const raw_transaction = res.raw_transaction; | ||
const signed_transaction = res.signed_transaction; | ||
@@ -476,5 +515,7 @@ | ||
const res = await simba.callContractMethod(appName, contractName, methodName) as Record<any, any>; | ||
``` | ||
// this endpoint is not yet returning the correct | ||
// testing Simba.submitSignedTransaction | ||
#### Submitting A Signed Transaction | ||
```TypeScript | ||
// Simba.submitSignedTransaction | ||
const simba = new Simba(); | ||
@@ -487,3 +528,6 @@ const txn = transactionObject; | ||
); | ||
``` | ||
#### Saving and Getting and Deploying Contract Designs and Artifacts | ||
```TypeScript | ||
// Simba.saveDesign | ||
@@ -498,9 +542,2 @@ const simba = new Simba(); | ||
// Simba.waitForDeployment | ||
const simba = new Simba(); | ||
const res = await simba.waitForDeployment( | ||
orgName, | ||
deploymentID, | ||
) as Record<any, any>; | ||
// Simba.deployDesign | ||
@@ -517,2 +554,13 @@ const simba = new Simba(); | ||
// Simba.getDesigns | ||
const simba = new Simba(); | ||
const res = await simba.getDesigns(orgName) as Record<any, any>; | ||
const design = res.results[0]; | ||
// Simba.createArtifact | ||
const simba = new Simba(); | ||
const designID = "644ed6cc-8073-4c4b-9395-aa466a3a27e7"; | ||
const artifact = await simba.createArtifact(orgName, designID) as Record<any, any>; | ||
// Simba.deployArtifact | ||
@@ -529,2 +577,30 @@ const simba = new Simba(); | ||
// Simba.getArtifacts | ||
const simba = new Simba(); | ||
const res = await simba.getArtifacts(orgName) as Record<any, any>; | ||
const artifact = res.results[0]; | ||
// Simba.getArtifact | ||
const simba = new Simba(); | ||
const artifactID = "af76b1a9-365a-428f-8749-cd23280b4ead"; | ||
const artifact = await simba.getArtifact(orgName, artifactID) as Record<any, any>; | ||
``` | ||
#### Method That Wait For Processes To Complete | ||
```TypeScript | ||
// Simba.waitForDeployment | ||
const simba = new Simba(); | ||
const res = await simba.waitForDeployment( | ||
orgName, | ||
deploymentID, | ||
) as Record<any, any>; | ||
// Simba.waitForOrgTransaction | ||
const simba = new Simba(); | ||
const res = await simba.waitForOrgTransaction( | ||
orgName, | ||
transactionID, | ||
) as Record<any, any>; | ||
// Simba.waitForDeployDesign | ||
@@ -551,16 +627,6 @@ const simba = new Simba(); | ||
); | ||
``` | ||
// Simba.waitForOrgTransaction | ||
const simba = new Simba(); | ||
const res = await simba.waitForOrgTransaction( | ||
orgName, | ||
transactionID, | ||
) as Record<any, any>; | ||
// Simba.getDesigns | ||
const simba = new Simba(); | ||
const res = await simba.getDesigns(orgName) as Record<any, any>; | ||
const design = res.results[0]; | ||
#### Getting Blockchains and Storages | ||
```TypeScript | ||
// Simba.getBlockchains | ||
@@ -575,21 +641,7 @@ const simba = new Simba(); | ||
const res = await simba.getStorages(orgName) as Record<any, any>; | ||
const storage = res.results[0]; | ||
``` | ||
// Simba.getArtifacts | ||
const simba = new Simba(); | ||
const res = await simba.getArtifacts(orgName) as Record<any, any>; | ||
const artifact = res.results[0]; | ||
// Simba.getArtifact | ||
const simba = new Simba(); | ||
const artifactID = "af76b1a9-365a-428f-8749-cd23280b4ead"; | ||
const artifact = await simba.getArtifact(orgName, artifactID) as Record<any, any>; | ||
// Simba.createArtifact | ||
const simba = new Simba(); | ||
const designID = "644ed6cc-8073-4c4b-9395-aa466a3a27e7"; | ||
const artifact = await simba.createArtifact(orgName, designID) as Record<any, any>; | ||
#### Subscriptions and Notifications | ||
```TypeScript | ||
// Simba.subscribe | ||
@@ -615,3 +667,2 @@ const simba = new Simba(); | ||
const res = await simba.setNotificationConfig(orgName, scheme, authType, authInfo) as Record<any, any>; | ||
``` | ||
@@ -622,2 +673,3 @@ | ||
#### Instantiating SimbaContract | ||
```TypeScript | ||
@@ -634,3 +686,6 @@ // instantiating SimbaContract object | ||
); | ||
``` | ||
#### SimbaContract Smart Contract Methods | ||
```TypeScript | ||
// SimbaContract.callMethod | ||
@@ -645,3 +700,2 @@ const simbaContract = new SimbaContract( | ||
// SimbaContract.submitMethod | ||
@@ -700,4 +754,6 @@ const simbaContract = new SimbaContract( | ||
) as Record<any, any>; | ||
``` | ||
#### SimbaContract Getting Transactions | ||
```TypeScript | ||
// SimbaContract.getTransactionsByMethod | ||
@@ -724,4 +780,6 @@ const simbaContract = new SimbaContract( | ||
const methodName = "structTest5"; | ||
``` | ||
#### SimbaContract Bundle File Methods | ||
```TypeScript | ||
// SimbaContract.getBundle | ||
@@ -741,3 +799,2 @@ const simbaContract = new SimbaContract( | ||
// SimbaContract.getBundleFile | ||
@@ -759,3 +816,2 @@ const simbaContract = new SimbaContract( | ||
// SimbaContract.getManifestForBundleFromBundleHash | ||
@@ -773,2 +829,3 @@ const simbaContract = new SimbaContract( | ||
#### Instantiating SimbaSync | ||
```TypeScript | ||
@@ -779,6 +836,9 @@ // istantiating SimbaSync object | ||
} from "@simbachain/simbats"; | ||
// testing Simba.getSimbaContract | ||
// Simba.getSimbaContract | ||
const simba = new SimbaSync(baseApiUrl); | ||
const simbaContractSync = simba.getSimbaContract(appName, contractName); | ||
``` | ||
#### Submitting a SimbaSync Smart Contract Method | ||
```TypeScript | ||
// Simba.submitContractMethodSync | ||
@@ -808,2 +868,3 @@ const simbaSync = new SimbaSync(); | ||
#### Instantiating SimbaContractSync | ||
```TypeScript | ||
@@ -820,3 +881,6 @@ // istantiating SimbaContractSync object | ||
); | ||
``` | ||
#### Submitting a SimbaContractSync Smart Contract Method | ||
```TypeScript | ||
// SimbaContractSync.submitMethod | ||
@@ -879,2 +943,3 @@ const simbaContractSync = new SimbaContractSync( | ||
/// UNDER CONSTRUCTION /// | ||
Polyglot is currently under construction, but will substantially streamline the process of interacting with your deployed smart contracts once fully implemented. | ||
@@ -881,0 +946,0 @@ ### Testing |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
284823
938