@stacks/transactions
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -35,7 +35,12 @@ /// <reference types="node" /> | ||
export declare function hexToCV(hex: string): ClarityValue; | ||
export interface ReadOnlyFunctionResponse { | ||
okay: boolean; | ||
export interface ReadOnlyFunctionSuccessResponse { | ||
okay: true; | ||
result: string; | ||
} | ||
export declare const parseReadOnlyResponse: ({ result }: ReadOnlyFunctionResponse) => ClarityValue; | ||
export interface ReadOnlyFunctionErrorResponse { | ||
okay: false; | ||
cause: string; | ||
} | ||
export declare type ReadOnlyFunctionResponse = ReadOnlyFunctionSuccessResponse | ReadOnlyFunctionErrorResponse; | ||
export declare const parseReadOnlyResponse: (response: ReadOnlyFunctionResponse) => ClarityValue; | ||
export declare const validateStacksAddress: (stacksAddress: string) => boolean; |
@@ -194,5 +194,8 @@ import './constants.esm.js'; | ||
} | ||
var parseReadOnlyResponse = function parseReadOnlyResponse(_ref) { | ||
var result = _ref.result; | ||
return hexToCV(result); | ||
var parseReadOnlyResponse = function parseReadOnlyResponse(response) { | ||
if (response.okay) { | ||
return hexToCV(response.result); | ||
} else { | ||
throw new Error(response.cause); | ||
} | ||
}; | ||
@@ -199,0 +202,0 @@ var validateStacksAddress = function validateStacksAddress(stacksAddress) { |
{ | ||
"name": "@stacks/transactions", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Javascript library for constructing transactions on the Stacks blockchain.", | ||
@@ -54,8 +54,7 @@ "homepage": "https://blockstack.org", | ||
"ts-node": "^8.10.2", | ||
"tsdx": "^0.14.0", | ||
"typescript": "^3.7.2" | ||
"tsdx": "^0.14.0" | ||
}, | ||
"dependencies": { | ||
"@stacks/common": "^1.0.1", | ||
"@stacks/network": "^1.0.1", | ||
"@stacks/network": "^1.0.2", | ||
"@types/bn.js": "^4.11.6", | ||
@@ -127,3 +126,3 @@ "@types/elliptic": "^6.4.12", | ||
"unpkg": "dist/transactions.cjs.production.min.js", | ||
"gitHead": "788006ea42257fc515c0678dd276ddd6dbdc2b9c" | ||
"gitHead": "2cf05938c1364dbfe45445f0297b64567ef91bc4" | ||
} |
@@ -40,8 +40,9 @@ # @stacks/transactions [![npm](https://img.shields.io/npm/v/@stacks/transactions?color=red)](https://www.npmjs.com/package/@stacks/transactions) | ||
makeStandardSTXPostCondition, | ||
StacksMainnet, | ||
broadcastTransaction, | ||
} from '@stacks/transactions'; | ||
import { StacksTestnet, StacksMainnet } from '@stacks/network'; | ||
const BigNum = require('bn.js'); | ||
const network = new StacksMainnet(); | ||
// for mainnet, use `StacksMainnet()` | ||
const network = new StacksTestnet(); | ||
@@ -70,6 +71,8 @@ const txOptions = { | ||
```javascript | ||
import { makeContractDeploy, StacksMainnet, broadcastTransaction } from '@stacks/transactions'; | ||
import { makeContractDeploy, broadcastTransaction } from '@stacks/transactions'; | ||
import { StacksTestnet, StacksMainnet } from '@stacks/network'; | ||
const BigNum = require('bn.js'); | ||
const network = new StacksMainnet(); | ||
// for mainnet, use `StacksMainnet()` | ||
const network = new StacksTestnet(); | ||
@@ -91,11 +94,8 @@ const txOptions = { | ||
```javascript | ||
import { | ||
makeContractCall, | ||
BufferCV, | ||
StacksMainnet, | ||
broadcastTransaction, | ||
} from '@stacks/transactions'; | ||
import { makeContractCall, BufferCV, broadcastTransaction } from '@stacks/transactions'; | ||
import { StacksTestnet, StacksMainnet } from '@stacks/network'; | ||
const BigNum = require('bn.js'); | ||
const network = new StacksMainnet(); | ||
// for mainnet, use `StacksMainnet()` | ||
const network = new StacksTestnet(); | ||
@@ -166,2 +166,3 @@ // Add an optional post condition | ||
} from '@stacks/transactions'; | ||
import { StacksTestnet, StacksMainnet } from '@stacks/network'; | ||
const BigNum = require('bn.js'); | ||
@@ -182,3 +183,4 @@ | ||
const network = new StacksMainnet(); | ||
// for mainnet, use `StacksMainnet()` | ||
const network = new StacksTestnet(); | ||
broadcastTransaction(sponsoredTx, network); | ||
@@ -185,0 +187,0 @@ ``` |
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 too big to display
Sorry, the diff of this file is not supported yet
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 too big to display
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
2265463
23
14830
461
8
Updated@stacks/network@^1.0.2