@stacks/stacking
Advanced tools
Comparing version 6.14.1-next.37 to 6.14.1-next.38
import { BaseErrorResponse, PaginationOptions, StacksNodeApi, V2PoxInfoResponse } from '@stacks/api'; | ||
import { ApiOpts, IntegerType, PrivateKey } from '@stacks/common'; | ||
import { StacksNetwork } from '@stacks/network'; | ||
import { StacksNetwork, StacksNetworkName } from '@stacks/network'; | ||
import { BurnchainRewardListResponse, BurnchainRewardSlotHolderListResponse, BurnchainRewardsTotal } from '@stacks/stacks-blockchain-api-types'; | ||
@@ -182,3 +182,3 @@ import { ContractCallOptions, StacksTransaction, TxBroadcastResult } from '@stacks/transactions'; | ||
address: string; | ||
network: StacksNetwork; | ||
network: StacksNetworkName | StacksNetwork; | ||
api?: StacksNodeApi | ApiOpts; | ||
@@ -185,0 +185,0 @@ }); |
import { StacksNodeApi, } from '@stacks/api'; | ||
import { hexToBytes, intToBigInt, isInstance, } from '@stacks/common'; | ||
import { networkFrom } from '@stacks/network'; | ||
import { ClarityType, broadcastTransaction, bufferCV, callReadOnlyFunction, cvToString, getFee, makeContractCall, noneCV, principalCV, principalToString, someCV, stringAsciiCV, uintCV, validateStacksAddress, } from '@stacks/transactions'; | ||
@@ -10,3 +11,3 @@ import { PoxOperationPeriod, StackingErrors } from './constants'; | ||
this.address = opts.address; | ||
this.network = opts.network; | ||
this.network = networkFrom(opts.network); | ||
this.api = isInstance(opts.api, StacksNodeApi) | ||
@@ -13,0 +14,0 @@ ? opts.api |
@@ -36,3 +36,3 @@ import { IntegerType, PrivateKey } from '@stacks/common'; | ||
period: number; | ||
network: StacksNetwork; | ||
network: StacksNetworkName | StacksNetwork; | ||
maxAmount: IntegerType; | ||
@@ -48,5 +48,5 @@ authId: IntegerType; | ||
}): boolean; | ||
export declare function pox4SignatureMessage({ topic, poxAddress, rewardCycle, period: lockPeriod, network, maxAmount, authId, }: Pox4SignatureOptions): { | ||
export declare function pox4SignatureMessage({ topic, poxAddress, rewardCycle, period: lockPeriod, network: networkOrName, maxAmount, authId, }: Pox4SignatureOptions): { | ||
message: TupleCV<import("@stacks/transactions").TupleData<import("@stacks/transactions").UIntCV | import("@stacks/transactions").StringAsciiCV | TupleCV<import("@stacks/transactions").TupleData<BufferCV>>>>; | ||
domain: TupleCV<import("@stacks/transactions").TupleData<import("@stacks/transactions").UIntCV | import("@stacks/transactions").StringAsciiCV>>; | ||
}; |
@@ -5,3 +5,3 @@ import { sha256 } from '@noble/hashes/sha256'; | ||
import { base58CheckDecode, base58CheckEncode, verifyMessageSignatureRsv, } from '@stacks/encryption'; | ||
import { StacksNetworks } from '@stacks/network'; | ||
import { StacksNetworks, networkFrom } from '@stacks/network'; | ||
import { ClarityType, bufferCV, encodeStructuredData, signStructuredData, stringAsciiCV, tupleCV, uintCV, } from '@stacks/transactions'; | ||
@@ -284,3 +284,4 @@ import { B58_ADDR_PREFIXES, BitcoinNetworkVersion, PoXAddressVersion, PoxOperationPeriod, SEGWIT_ADDR_PREFIXES, SEGWIT_V0, SEGWIT_V0_ADDR_PREFIX, SEGWIT_V1, SEGWIT_V1_ADDR_PREFIX, SegwitPrefix, StackingErrors, } from './constants'; | ||
} | ||
export function pox4SignatureMessage({ topic, poxAddress, rewardCycle, period: lockPeriod, network, maxAmount, authId, }) { | ||
export function pox4SignatureMessage({ topic, poxAddress, rewardCycle, period: lockPeriod, network: networkOrName, maxAmount, authId, }) { | ||
const network = networkFrom(networkOrName); | ||
const message = tupleCV({ | ||
@@ -287,0 +288,0 @@ 'pox-addr': poxAddressToTuple(poxAddress), |
import { BaseErrorResponse, PaginationOptions, StacksNodeApi, V2PoxInfoResponse } from '@stacks/api'; | ||
import { ApiOpts, IntegerType, PrivateKey } from '@stacks/common'; | ||
import { StacksNetwork } from '@stacks/network'; | ||
import { StacksNetwork, StacksNetworkName } from '@stacks/network'; | ||
import { BurnchainRewardListResponse, BurnchainRewardSlotHolderListResponse, BurnchainRewardsTotal } from '@stacks/stacks-blockchain-api-types'; | ||
@@ -182,3 +182,3 @@ import { ContractCallOptions, StacksTransaction, TxBroadcastResult } from '@stacks/transactions'; | ||
address: string; | ||
network: StacksNetwork; | ||
network: StacksNetworkName | StacksNetwork; | ||
api?: StacksNodeApi | ApiOpts; | ||
@@ -185,0 +185,0 @@ }); |
@@ -20,2 +20,3 @@ "use strict"; | ||
const common_1 = require("@stacks/common"); | ||
const network_1 = require("@stacks/network"); | ||
const transactions_1 = require("@stacks/transactions"); | ||
@@ -28,3 +29,3 @@ const constants_1 = require("./constants"); | ||
this.address = opts.address; | ||
this.network = opts.network; | ||
this.network = (0, network_1.networkFrom)(opts.network); | ||
this.api = (0, common_1.isInstance)(opts.api, api_1.StacksNodeApi) | ||
@@ -31,0 +32,0 @@ ? opts.api |
@@ -36,3 +36,3 @@ import { IntegerType, PrivateKey } from '@stacks/common'; | ||
period: number; | ||
network: StacksNetwork; | ||
network: StacksNetworkName | StacksNetwork; | ||
maxAmount: IntegerType; | ||
@@ -48,5 +48,5 @@ authId: IntegerType; | ||
}): boolean; | ||
export declare function pox4SignatureMessage({ topic, poxAddress, rewardCycle, period: lockPeriod, network, maxAmount, authId, }: Pox4SignatureOptions): { | ||
export declare function pox4SignatureMessage({ topic, poxAddress, rewardCycle, period: lockPeriod, network: networkOrName, maxAmount, authId, }: Pox4SignatureOptions): { | ||
message: TupleCV<import("@stacks/transactions").TupleData<import("@stacks/transactions").UIntCV | import("@stacks/transactions").StringAsciiCV | TupleCV<import("@stacks/transactions").TupleData<BufferCV>>>>; | ||
domain: TupleCV<import("@stacks/transactions").TupleData<import("@stacks/transactions").UIntCV | import("@stacks/transactions").StringAsciiCV>>; | ||
}; |
@@ -300,3 +300,4 @@ "use strict"; | ||
exports.verifyPox4SignatureHash = verifyPox4SignatureHash; | ||
function pox4SignatureMessage({ topic, poxAddress, rewardCycle, period: lockPeriod, network, maxAmount, authId, }) { | ||
function pox4SignatureMessage({ topic, poxAddress, rewardCycle, period: lockPeriod, network: networkOrName, maxAmount, authId, }) { | ||
const network = (0, network_1.networkFrom)(networkOrName); | ||
const message = (0, transactions_1.tupleCV)({ | ||
@@ -303,0 +304,0 @@ 'pox-addr': poxAddressToTuple(poxAddress), |
{ | ||
"name": "@stacks/stacking", | ||
"version": "6.14.1-next.37+dfaf76f4", | ||
"version": "6.14.1-next.38+3d92cc71", | ||
"description": "Library for Stacking.", | ||
@@ -25,8 +25,8 @@ "license": "MIT", | ||
"@scure/base": "1.1.1", | ||
"@stacks/api": "^6.14.1-next.37+dfaf76f4", | ||
"@stacks/common": "^6.14.1-next.37+dfaf76f4", | ||
"@stacks/encryption": "^6.14.1-next.37+dfaf76f4", | ||
"@stacks/network": "^6.14.1-next.37+dfaf76f4", | ||
"@stacks/api": "^6.14.1-next.38+3d92cc71", | ||
"@stacks/common": "^6.14.1-next.38+3d92cc71", | ||
"@stacks/encryption": "^6.14.1-next.38+3d92cc71", | ||
"@stacks/network": "^6.14.1-next.38+3d92cc71", | ||
"@stacks/stacks-blockchain-api-types": "^0.61.0", | ||
"@stacks/transactions": "^6.14.1-next.37+dfaf76f4", | ||
"@stacks/transactions": "^6.14.1-next.38+3d92cc71", | ||
"bs58": "^5.0.0" | ||
@@ -62,3 +62,3 @@ }, | ||
}, | ||
"gitHead": "dfaf76f46ea1663dd0074a6fa02ee627e5aade21" | ||
"gitHead": "3d92cc71fbdc199225fd71111e890ac55ae28022" | ||
} |
@@ -16,3 +16,3 @@ import { | ||
} from '@stacks/common'; | ||
import { StacksNetwork } from '@stacks/network'; | ||
import { StacksNetwork, StacksNetworkName, networkFrom } from '@stacks/network'; | ||
import { | ||
@@ -345,5 +345,10 @@ BurnchainRewardListResponse, | ||
constructor(opts: { address: string; network: StacksNetwork; api?: StacksNodeApi | ApiOpts }) { | ||
// todo: make more constructor opts optional | ||
constructor(opts: { | ||
address: string; | ||
network: StacksNetworkName | StacksNetwork; | ||
api?: StacksNodeApi | ApiOpts; | ||
}) { | ||
this.address = opts.address; | ||
this.network = opts.network; | ||
this.network = networkFrom(opts.network); | ||
this.api = isInstance(opts.api, StacksNodeApi) | ||
@@ -350,0 +355,0 @@ ? opts.api |
@@ -9,3 +9,3 @@ import { sha256 } from '@noble/hashes/sha256'; | ||
} from '@stacks/encryption'; | ||
import { StacksNetwork, StacksNetworkName, StacksNetworks } from '@stacks/network'; | ||
import { StacksNetwork, StacksNetworkName, StacksNetworks, networkFrom } from '@stacks/network'; | ||
import { | ||
@@ -321,2 +321,3 @@ BufferCV, | ||
export function poxAddressToBtcAddress(...args: any[]): string { | ||
// todo: allow these helpers to take a bitcoin network instead of a stacks network, once we have a concept of bitcoin networks in the codebase | ||
if (typeof args[0] === 'number') return _poxAddressToBtcAddress_Values(args[0], args[1], args[2]); | ||
@@ -416,3 +417,3 @@ return _poxAddressToBtcAddress_ClarityValue(args[0], args[1]); | ||
period: number; | ||
network: StacksNetwork; | ||
network: StacksNetworkName | StacksNetwork; | ||
/** Maximum amount of uSTX that can be locked during this function call */ | ||
@@ -478,6 +479,7 @@ maxAmount: IntegerType; | ||
period: lockPeriod, | ||
network, | ||
network: networkOrName, | ||
maxAmount, | ||
authId, | ||
}: Pox4SignatureOptions) { | ||
const network = networkFrom(networkOrName); | ||
const message = tupleCV({ | ||
@@ -484,0 +486,0 @@ 'pox-addr': poxAddressToTuple(poxAddress), |
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
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
1100672
5691