@burstjs/core
Advanced tools
Comparing version 0.5.0-alpha.3 to 0.5.0-beta.1
@@ -38,3 +38,4 @@ module.exports = { | ||
'generateContract', | ||
'calculateMinimumCreationFee' | ||
'calculateMinimumCreationFee', | ||
'generateMethodCall' | ||
], | ||
@@ -41,0 +42,0 @@ '@burstjs/util': [ |
@@ -14,3 +14,3 @@ # Change Log | ||
- `callContractMethod` | ||
- `commitContract` | ||
- `publishContract` | ||
@@ -17,0 +17,0 @@ ## 0.4.3 |
@@ -7,5 +7,5 @@ import { Api } from '../typings/api'; | ||
apiVersion: ApiVersion; | ||
httpOptions?: any | AxiosRequestConfig; | ||
constructor(nodeHost: string, apiVersion?: ApiVersion, httpOptions?: any | AxiosRequestConfig); | ||
httpClientOptions?: any | AxiosRequestConfig; | ||
constructor(nodeHost: string, apiVersion?: ApiVersion, httpClientOptions?: any | AxiosRequestConfig); | ||
} | ||
export declare function composeApi(settings: ApiSettings): Api; |
@@ -5,1 +5,2 @@ export * from './getContract'; | ||
export * from './publishContract'; | ||
export * from './callContractMethod'; |
@@ -6,2 +6,3 @@ import { Contract } from '../contract'; | ||
import { TransactionId } from '../transactionId'; | ||
import { CallContractMethodArgs } from '../args/callContractMethodArgs'; | ||
export interface ContractApi { | ||
@@ -12,2 +13,3 @@ getContract: (id: string) => Promise<Contract>; | ||
publishContract: (args: PublishContractArgs) => Promise<TransactionId>; | ||
callContractMethod: (args: CallContractMethodArgs) => Promise<TransactionId>; | ||
} |
@@ -6,1 +6,2 @@ export * from './sendAmountArgs'; | ||
export * from './publishContractArgs'; | ||
export * from './callContractMethodArgs'; |
@@ -7,5 +7,5 @@ import { Api } from '../typings/api'; | ||
apiVersion: ApiVersion; | ||
httpOptions?: any | AxiosRequestConfig; | ||
constructor(nodeHost: string, apiVersion?: ApiVersion, httpOptions?: any | AxiosRequestConfig); | ||
httpClientOptions?: any | AxiosRequestConfig; | ||
constructor(nodeHost: string, apiVersion?: ApiVersion, httpClientOptions?: any | AxiosRequestConfig); | ||
} | ||
export declare function composeApi(settings: ApiSettings): Api; |
@@ -15,6 +15,6 @@ "use strict"; | ||
class ApiSettings { | ||
constructor(nodeHost, apiVersion = apiVersion_1.ApiVersion.V1, httpOptions) { | ||
constructor(nodeHost, apiVersion = apiVersion_1.ApiVersion.V1, httpClientOptions) { | ||
this.nodeHost = nodeHost; | ||
this.apiVersion = apiVersion; | ||
this.httpOptions = httpOptions; | ||
this.httpClientOptions = httpClientOptions; | ||
} | ||
@@ -79,2 +79,3 @@ } | ||
publishContract: contract_1.publishContract, | ||
callContractMethod: contract_1.callContractMethod, | ||
}).withAssetApi({ | ||
@@ -81,0 +82,0 @@ getAsset: asset_1.getAsset, |
@@ -5,1 +5,2 @@ export * from './getContract'; | ||
export * from './publishContract'; | ||
export * from './callContractMethod'; |
@@ -10,2 +10,3 @@ "use strict"; | ||
__export(require("./publishContract")); | ||
__export(require("./callContractMethod")); | ||
//# sourceMappingURL=index.js.map |
@@ -27,2 +27,3 @@ "use strict"; | ||
uspages: 1, | ||
broadcast: true, | ||
}; | ||
@@ -29,0 +30,0 @@ const { unsignedTransactionBytes: unsignedHexMessage } = yield service.send('createATProgram', parameters); |
@@ -16,3 +16,3 @@ "use strict"; | ||
constructor(settings) { | ||
this.apiRootUrl = settings.apiRootUrl || '/burst'; | ||
this.apiRootUrl = settings.apiRootUrl || constants_1.DefaultApiEndpoint; | ||
this.nodeHost = settings.nodeHost; | ||
@@ -19,0 +19,0 @@ this.httpClient = settings.httpClient || new http_1.HttpImpl(settings.nodeHost, settings.httpClientOptions); |
@@ -6,2 +6,3 @@ import { Contract } from '../contract'; | ||
import { TransactionId } from '../transactionId'; | ||
import { CallContractMethodArgs } from '../args/callContractMethodArgs'; | ||
export interface ContractApi { | ||
@@ -12,2 +13,3 @@ getContract: (id: string) => Promise<Contract>; | ||
publishContract: (args: PublishContractArgs) => Promise<TransactionId>; | ||
callContractMethod: (args: CallContractMethodArgs) => Promise<TransactionId>; | ||
} |
@@ -6,1 +6,2 @@ export * from './sendAmountArgs'; | ||
export * from './publishContractArgs'; | ||
export * from './callContractMethodArgs'; |
@@ -6,3 +6,2 @@ export interface PublishContractArgs { | ||
description: string; | ||
publishFeePlanck: string; | ||
name: string; | ||
@@ -9,0 +8,0 @@ senderPublicKey: string; |
{ | ||
"name": "@burstjs/core", | ||
"version": "0.5.0-alpha.3", | ||
"version": "0.5.0-beta.1", | ||
"description": "Burst-related functions and models for building Burstcoin applications.", | ||
@@ -50,6 +50,6 @@ "contributors": [ | ||
"dependencies": { | ||
"@burstjs/contracts": "^0.5.0-alpha.3", | ||
"@burstjs/crypto": "^0.5.0-alpha.3", | ||
"@burstjs/http": "^0.5.0-alpha.3", | ||
"@burstjs/util": "^0.5.0-alpha.3" | ||
"@burstjs/contracts": "^0.5.0-beta.1", | ||
"@burstjs/crypto": "^0.5.0-beta.1", | ||
"@burstjs/http": "^0.5.0-beta.1", | ||
"@burstjs/util": "^0.5.0-beta.1" | ||
}, | ||
@@ -61,3 +61,3 @@ "husky": { | ||
}, | ||
"gitHead": "92c2c5bf2ce352638613fe27ab1f247552d1b376", | ||
"gitHead": "33d6f8370f2bdac3c4730fdd29331625933aadf9", | ||
"publishConfig": { | ||
@@ -64,0 +64,0 @@ "access": "public" |
import {ApiSettings, composeApi} from '../composeApi'; | ||
import {ApiVersion} from '../../constants/apiVersion'; | ||
@@ -8,4 +9,10 @@ describe('composeApi', () => { | ||
'nodeHost', | ||
'apiRootUrl' | ||
ApiVersion.V1, | ||
{ | ||
headers: { | ||
'X-Test': 'some test' | ||
} | ||
} | ||
)); | ||
expect(api.asset).toBeDefined(); | ||
@@ -12,0 +19,0 @@ expect(api.account).toBeDefined(); |
@@ -5,3 +5,2 @@ import {Http, HttpMockBuilder} from '@burstjs/http'; | ||
import {generateSignature, generateSignedTransactionBytes, verifySignature} from '@burstjs/crypto'; | ||
import {generateContract} from '@burstjs/contracts'; | ||
@@ -78,3 +77,2 @@ describe('Contract Api', () => { | ||
generateSignedTransactionBytes = jest.fn(() => 'signedTransactionBytes'); | ||
generateContract = jest.fn(() => 'hexCode'); | ||
}); | ||
@@ -98,3 +96,2 @@ | ||
description: 'description', | ||
feePlanck: '10000000', | ||
name: 'testContract', | ||
@@ -101,0 +98,0 @@ senderPublicKey: 'publickey', |
@@ -28,3 +28,3 @@ /** @module core.api */ | ||
import {getAliasById, getAliasByName} from './factories/alias'; | ||
import {getAllContractIds, getContract, getContractsByAccount, publishContract} from './factories/contract'; | ||
import {getAllContractIds, getContract, getContractsByAccount, publishContract, callContractMethod} from './factories/contract'; | ||
import { | ||
@@ -49,3 +49,3 @@ broadcastTransaction, | ||
* @param apiVersion {ApiVersion} For future usage. | ||
* @param httpOptions {any | AxiosRequestSettings} Optional http options, like additional header. | ||
* @param httpClientOptions {any | AxiosRequestSettings} Optional http options, like additional header. | ||
* The default implementation uses axios. In case of a custom client pass your own options. | ||
@@ -58,3 +58,3 @@ * see [Axios Configuration](https://github.com/axios/axios#request-config) | ||
public apiVersion: ApiVersion = ApiVersion.V1, | ||
public httpOptions?: any | AxiosRequestConfig, | ||
public httpClientOptions?: any | AxiosRequestConfig, | ||
) { | ||
@@ -138,2 +138,3 @@ } | ||
publishContract, | ||
callContractMethod, | ||
}).withAssetApi({ | ||
@@ -140,0 +141,0 @@ getAsset, |
@@ -7,1 +7,2 @@ /** @module core.api.factories */ | ||
export * from './publishContract'; | ||
export * from './callContractMethod'; |
@@ -35,2 +35,3 @@ /** @module core.api.factories */ | ||
uspages: 1, | ||
broadcast: true, | ||
}; | ||
@@ -37,0 +38,0 @@ |
@@ -21,3 +21,3 @@ /** @module core */ | ||
constructor(settings: BurstServiceSettings) { | ||
this.apiRootUrl = settings.apiRootUrl || '/burst'; | ||
this.apiRootUrl = settings.apiRootUrl || DefaultApiEndpoint; | ||
this.nodeHost = settings.nodeHost; | ||
@@ -24,0 +24,0 @@ this.httpClient = settings.httpClient || new HttpImpl(settings.nodeHost, settings.httpClientOptions); |
@@ -8,2 +8,3 @@ /** @module core.api */ | ||
import {TransactionId} from '../transactionId'; | ||
import {CallContractMethodArgs} from '../args/callContractMethodArgs'; | ||
@@ -45,2 +46,9 @@ /** | ||
/** | ||
* Calls a public method of smart contract | ||
* @param args {CallContractMethodArgs} The argument object | ||
* @return {TransactionId} The transaction id in case of success | ||
*/ | ||
callContractMethod: (args: CallContractMethodArgs) => Promise<TransactionId>; | ||
} |
@@ -8,1 +8,3 @@ /** @module core */ | ||
export * from './publishContractArgs'; | ||
export * from './callContractMethodArgs'; | ||
@@ -5,3 +5,3 @@ /** @module core */ | ||
/** | ||
* The argument object for [[ContractApi.publishContrac]] | ||
* The argument object for [[ContractApi.publishContract]] | ||
* | ||
@@ -11,3 +11,2 @@ * @param codeHex {string} | ||
* @param description {string} | ||
* @param publishFeePlanck {string} The publishing fee for the contract | ||
* @param activationAmountPlanck {string} | ||
@@ -24,3 +23,2 @@ * @param name {string} | ||
description: string; | ||
publishFeePlanck: string; | ||
name: string; | ||
@@ -27,0 +25,0 @@ senderPublicKey: string; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
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
660
30990
2802006
5999