@cardano-sdk/core
Advanced tools
Comparing version 0.1.5 to 0.1.6
@@ -0,3 +1,3 @@ | ||
import { CSL } from '../CSL'; | ||
import { TokenMap } from '../Cardano'; | ||
import { CSL } from '../CSL'; | ||
export declare type AssetId = string; | ||
@@ -8,6 +8,6 @@ export declare const policyIdFromAssetId: (assetId: AssetId) => string; | ||
export declare const parseAssetId: (assetId: AssetId) => { | ||
assetName: CSL.AssetName; | ||
scriptHash: CSL.ScriptHash; | ||
assetName: CSL.AssetName; | ||
}; | ||
export declare const coalesceTokenMaps: (totals: (TokenMap | undefined)[]) => TokenMap | undefined; | ||
//# sourceMappingURL=util.d.ts.map |
@@ -15,4 +15,4 @@ "use strict"; | ||
return { | ||
scriptHash: CSL_1.CSL.ScriptHash.from_bytes(Buffer.from(policyId, 'hex')), | ||
assetName: CSL_1.CSL.AssetName.new(Buffer.from(assetName, 'hex')) | ||
assetName: CSL_1.CSL.AssetName.new(Buffer.from(assetName, 'hex')), | ||
scriptHash: CSL_1.CSL.ScriptHash.from_bytes(Buffer.from(policyId, 'hex')) | ||
}; | ||
@@ -19,0 +19,0 @@ }; |
@@ -1,6 +0,6 @@ | ||
import { PoolId, Lovelace } from '.'; | ||
import { Lovelace, PoolId } from '.'; | ||
export interface DelegationsAndRewards { | ||
delegate?: PoolId; | ||
rewards?: Lovelace; | ||
rewards: Lovelace; | ||
} | ||
//# sourceMappingURL=DelegationsAndRewards.d.ts.map |
import { PoolId } from '.'; | ||
export declare type SerialNumber = number; | ||
export declare type DeclaredPoolLocation = string; | ||
export declare type PoolStatus = 'active' | 'retired' | 'offline' | 'experimental' | 'private'; | ||
export declare enum ExtendedPoolStatus { | ||
Active = "active", | ||
Retired = "retired", | ||
Offline = "offline", | ||
Experimental = "experimental", | ||
Private = "private" | ||
} | ||
export declare type PrimaryContactPreference = string; | ||
@@ -45,3 +51,3 @@ export declare type EmailAddress = string; | ||
country?: DeclaredPoolLocation; | ||
status?: PoolStatus; | ||
status?: ExtendedPoolStatus; | ||
contact?: PoolContactData; | ||
@@ -48,0 +54,0 @@ media_assets?: ThePoolsMediaAssets; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ExtendedPoolStatus = void 0; | ||
var ExtendedPoolStatus; | ||
(function (ExtendedPoolStatus) { | ||
ExtendedPoolStatus["Active"] = "active"; | ||
ExtendedPoolStatus["Retired"] = "retired"; | ||
ExtendedPoolStatus["Offline"] = "offline"; | ||
ExtendedPoolStatus["Experimental"] = "experimental"; | ||
ExtendedPoolStatus["Private"] = "private"; | ||
})(ExtendedPoolStatus = exports.ExtendedPoolStatus || (exports.ExtendedPoolStatus = {})); | ||
//# sourceMappingURL=ExtendedStakePoolMetadata.js.map |
@@ -10,4 +10,8 @@ import * as Ogmios from '@cardano-ogmios/schema'; | ||
export * from './Transaction'; | ||
export * from './Certificate'; | ||
export * from './Genesis'; | ||
export * from './Block'; | ||
export declare type Ed25519KeyHashBech32 = string; | ||
export declare type ProtocolParametersAlonzo = util.OptionalUndefined<util.RecursivelyReplaceNullWithUndefined<Ogmios.ProtocolParametersAlonzo>>; | ||
export declare type ValidityInterval = util.OptionalUndefined<util.RecursivelyReplaceNullWithUndefined<Ogmios.ValidityInterval>>; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -19,2 +19,5 @@ "use strict"; | ||
__exportStar(require("./Transaction"), exports); | ||
__exportStar(require("./Certificate"), exports); | ||
__exportStar(require("./Genesis"), exports); | ||
__exportStar(require("./Block"), exports); | ||
//# sourceMappingURL=index.js.map |
@@ -1,4 +0,3 @@ | ||
import { PoolParameters } from '@cardano-ogmios/schema'; | ||
import { Hash16, Lovelace, PoolMetadata } from '.'; | ||
import { ExtendedStakePoolMetadata } from './ExtendedStakePoolMetadata'; | ||
import { Hash16, Lovelace, PoolParameters } from '.'; | ||
export declare type Percent = number; | ||
@@ -40,23 +39,14 @@ export declare type TransactionId = Hash16; | ||
} | ||
export interface ByAddress { | ||
ipv4?: string; | ||
ipv6?: string; | ||
port?: number; | ||
export declare enum StakePoolStatus { | ||
Active = "active", | ||
Retired = "retired", | ||
Retiring = "retiring" | ||
} | ||
export interface ByName { | ||
hostname: string; | ||
port?: number; | ||
} | ||
export declare type Relay = ByAddress | ByName; | ||
export interface StakePool extends Omit<PoolParameters, 'pledge' | 'cost' | 'margin' | 'metadata' | 'relays'> { | ||
export interface StakePool extends PoolParameters { | ||
hexId: Hash16; | ||
pledge: Lovelace; | ||
cost: Lovelace; | ||
margin: Percent; | ||
metrics: StakePoolMetrics; | ||
relays: Relay[]; | ||
status: StakePoolStatus; | ||
transactions: StakePoolTransactions; | ||
metadataJson?: PoolMetadata; | ||
metadata?: StakePoolMetadata; | ||
} | ||
//# sourceMappingURL=StakePool.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.StakePoolStatus = void 0; | ||
var StakePoolStatus; | ||
(function (StakePoolStatus) { | ||
StakePoolStatus["Active"] = "active"; | ||
StakePoolStatus["Retired"] = "retired"; | ||
StakePoolStatus["Retiring"] = "retiring"; | ||
})(StakePoolStatus = exports.StakePoolStatus || (exports.StakePoolStatus = {})); | ||
//# sourceMappingURL=StakePool.js.map |
@@ -5,51 +5,8 @@ import * as Cardano from '.'; | ||
export declare type PartialBlockHeader = Pick<OgmiosHeader, 'blockHeight' | 'slot' | 'blockHash'>; | ||
export declare type Ed25519SignatureHash16 = string; | ||
export interface Withdrawal { | ||
address: Cardano.Address; | ||
stakeAddress: Cardano.Address; | ||
quantity: Cardano.Lovelace; | ||
} | ||
export declare enum CertificateType { | ||
StakeRegistration = "StakeRegistration", | ||
StakeDeregistration = "StakeDeregistration", | ||
PoolRegistration = "PoolRegistration", | ||
PoolRetirement = "PoolRetirement", | ||
StakeDelegation = "StakeDelegation", | ||
MIR = "MoveInstantaneousRewards", | ||
GenesisKeyDelegation = "GenesisKeyDelegation" | ||
} | ||
export interface StakeAddressCertificate { | ||
type: CertificateType.StakeRegistration | CertificateType.StakeDeregistration; | ||
certIndex: number; | ||
address: Cardano.Address; | ||
} | ||
export interface PoolCertificate { | ||
type: CertificateType.PoolRegistration | CertificateType.PoolRetirement; | ||
certIndex: number; | ||
poolId: Cardano.PoolId; | ||
epoch: Cardano.Epoch; | ||
} | ||
export interface StakeDelegationCertificate { | ||
type: CertificateType.StakeDelegation; | ||
certIndex: number; | ||
delegationIndex: number; | ||
address: Cardano.Address; | ||
poolId: Cardano.PoolId; | ||
epoch: Cardano.Epoch; | ||
} | ||
export interface MirCertificate { | ||
type: CertificateType.MIR; | ||
certIndex: number; | ||
address: Cardano.Address; | ||
quantity: Cardano.Lovelace; | ||
pot: 'reserve' | 'treasury'; | ||
} | ||
export interface GenesisKeyDelegationCertificate { | ||
type: CertificateType.GenesisKeyDelegation; | ||
certIndex: number; | ||
genesisHash: Cardano.Hash16; | ||
genesisDelegateHash: Cardano.Hash16; | ||
vrfKeyHash: Cardano.Hash16; | ||
} | ||
export declare type Certificate = StakeAddressCertificate | PoolCertificate | StakeDelegationCertificate | MirCertificate | GenesisKeyDelegationCertificate; | ||
export interface TxBodyAlonzo { | ||
index: number; | ||
inputs: Cardano.TxIn[]; | ||
@@ -61,3 +18,3 @@ collaterals?: Cardano.TxIn[]; | ||
withdrawals?: Withdrawal[]; | ||
certificates?: Certificate[]; | ||
certificates?: Cardano.Certificate[]; | ||
mint?: Cardano.TokenMap; | ||
@@ -77,7 +34,11 @@ scriptIntegrityHash?: Cardano.Hash16; | ||
} | ||
export declare type Witness = Omit<Partial<BlockBodyAlonzo['witness']>, 'redeemers'> & { | ||
export declare type Witness = Omit<Partial<BlockBodyAlonzo['witness']>, 'redeemers' | 'signatures'> & { | ||
redeemers?: Redeemer[]; | ||
signatures: Partial<{ | ||
[k: string]: Ed25519SignatureHash16; | ||
}>; | ||
}; | ||
export interface TxAlonzo { | ||
id: Cardano.Hash16; | ||
index: number; | ||
blockHeader: PartialBlockHeader; | ||
@@ -88,13 +49,6 @@ body: TxBodyAlonzo; | ||
witness: Witness; | ||
metadata?: Cardano.AuxiliaryData; | ||
auxiliaryData?: Cardano.AuxiliaryData; | ||
} | ||
export declare enum TransactionStatus { | ||
Pending = "pending", | ||
Confirmed = "confirmed" | ||
} | ||
export interface SubmittedTransaction { | ||
tx: TxAlonzo; | ||
status: TransactionStatus; | ||
} | ||
export declare type NewTxAlonzo = Omit<TxAlonzo, 'blockHeader' | 'implicitCoin' | 'txSize' | 'index'>; | ||
export {}; | ||
//# sourceMappingURL=Transaction.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.TransactionStatus = exports.CertificateType = void 0; | ||
var CertificateType; | ||
(function (CertificateType) { | ||
CertificateType["StakeRegistration"] = "StakeRegistration"; | ||
CertificateType["StakeDeregistration"] = "StakeDeregistration"; | ||
CertificateType["PoolRegistration"] = "PoolRegistration"; | ||
CertificateType["PoolRetirement"] = "PoolRetirement"; | ||
CertificateType["StakeDelegation"] = "StakeDelegation"; | ||
CertificateType["MIR"] = "MoveInstantaneousRewards"; | ||
CertificateType["GenesisKeyDelegation"] = "GenesisKeyDelegation"; | ||
})(CertificateType = exports.CertificateType || (exports.CertificateType = {})); | ||
var TransactionStatus; | ||
(function (TransactionStatus) { | ||
TransactionStatus["Pending"] = "pending"; | ||
TransactionStatus["Confirmed"] = "confirmed"; | ||
})(TransactionStatus = exports.TransactionStatus || (exports.TransactionStatus = {})); | ||
//# sourceMappingURL=Transaction.js.map |
@@ -1,2 +0,2 @@ | ||
import { Hash16, Address } from '.'; | ||
import { Address, Hash16 } from '.'; | ||
import { TxIn as OgmiosTxIn } from '@cardano-ogmios/schema'; | ||
@@ -3,0 +3,0 @@ import { Value } from './Value'; |
@@ -8,6 +8,6 @@ "use strict"; | ||
const coalesceValueQuantities = (quantities) => ({ | ||
coins: __1.BigIntMath.sum(quantities.map(({ coins }) => coins)), | ||
assets: __1.Asset.util.coalesceTokenMaps(quantities.map(({ assets }) => assets)) | ||
assets: __1.Asset.util.coalesceTokenMaps(quantities.map(({ assets }) => assets)), | ||
coins: __1.BigIntMath.sum(quantities.map(({ coins }) => coins)) | ||
}); | ||
exports.coalesceValueQuantities = coalesceValueQuantities; | ||
//# sourceMappingURL=util.js.map |
@@ -1,3 +0,4 @@ | ||
import { TransactionInput, TransactionOutput, TransactionUnspentOutput, Value } from '@emurgo/cardano-serialization-lib-nodejs'; | ||
import * as Cardano from '../Cardano'; | ||
import { Transaction, TransactionBody, TransactionInput, TransactionOutput, TransactionUnspentOutput, Value } from '@emurgo/cardano-serialization-lib-nodejs'; | ||
export * as certificate from './certificate'; | ||
export declare const value: ({ coins, assets }: Cardano.Value) => Value; | ||
@@ -7,2 +8,4 @@ export declare const txIn: (core: Cardano.TxIn) => TransactionInput; | ||
export declare const utxo: (core: Cardano.Utxo[]) => TransactionUnspentOutput[]; | ||
export declare const txBody: ({ inputs, outputs, fee, validityInterval, certificates, withdrawals }: Cardano.TxBodyAlonzo) => TransactionBody; | ||
export declare const tx: ({ body, witness }: Cardano.NewTxAlonzo) => Transaction; | ||
//# sourceMappingURL=coreToCsl.d.ts.map |
@@ -22,5 +22,10 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.utxo = exports.txOut = exports.txIn = exports.value = void 0; | ||
exports.tx = exports.txBody = exports.utxo = exports.txOut = exports.txIn = exports.value = exports.certificate = void 0; | ||
const Asset = __importStar(require("../Asset")); | ||
const cardano_serialization_lib_nodejs_1 = require("@emurgo/cardano-serialization-lib-nodejs"); | ||
const Asset = __importStar(require("../Asset")); | ||
const certificate = __importStar(require("./certificate")); | ||
const errors_1 = require("../errors"); | ||
const __1 = require(".."); | ||
const _1 = require("."); | ||
exports.certificate = __importStar(require("./certificate")); | ||
const value = ({ coins, assets }) => { | ||
@@ -52,2 +57,51 @@ const result = cardano_serialization_lib_nodejs_1.Value.new(cardano_serialization_lib_nodejs_1.BigNum.from_str(coins.toString())); | ||
exports.utxo = utxo; | ||
const txBody = ({ inputs, outputs, fee, validityInterval, certificates, withdrawals }) => { | ||
const cslInputs = cardano_serialization_lib_nodejs_1.TransactionInputs.new(); | ||
for (const input of inputs) { | ||
cslInputs.add(exports.txIn(input)); | ||
} | ||
const cslOutputs = cardano_serialization_lib_nodejs_1.TransactionOutputs.new(); | ||
for (const output of outputs) { | ||
cslOutputs.add(exports.txOut(output)); | ||
} | ||
const cslBody = cardano_serialization_lib_nodejs_1.TransactionBody.new(cslInputs, cslOutputs, cardano_serialization_lib_nodejs_1.BigNum.from_str(fee.toString()), validityInterval.invalidHereafter); | ||
if (validityInterval.invalidBefore) { | ||
cslBody.set_validity_start_interval(validityInterval.invalidBefore); | ||
} | ||
if (certificates?.length) { | ||
const certs = cardano_serialization_lib_nodejs_1.Certificates.new(); | ||
for (const cert of certificates) { | ||
certs.add(certificate.create(cert)); | ||
} | ||
cslBody.set_certs(certs); | ||
} | ||
if (withdrawals?.length) { | ||
const cslWithdrawals = cardano_serialization_lib_nodejs_1.Withdrawals.new(); | ||
for (const { stakeAddress, quantity } of withdrawals) { | ||
const cslAddress = cardano_serialization_lib_nodejs_1.RewardAddress.from_address(cardano_serialization_lib_nodejs_1.Address.from_bech32(stakeAddress)); | ||
if (!cslAddress) { | ||
throw new errors_1.SerializationError(__1.SerializationFailure.InvalidAddress, `Invalid withdrawal address: ${stakeAddress}`); | ||
} | ||
cslWithdrawals.insert(cslAddress, cardano_serialization_lib_nodejs_1.BigNum.from_str(quantity.toString())); | ||
} | ||
cslBody.set_withdrawals(cslWithdrawals); | ||
} | ||
return cslBody; | ||
}; | ||
exports.txBody = txBody; | ||
const tx = ({ body, witness }) => { | ||
const witnessSet = cardano_serialization_lib_nodejs_1.TransactionWitnessSet.new(); | ||
const vkeyWitnesses = cardano_serialization_lib_nodejs_1.Vkeywitnesses.new(); | ||
for (const vkey in witness.signatures) { | ||
if (Object.prototype.hasOwnProperty.call(witness.signatures, vkey)) { | ||
const signature = witness.signatures[vkey]; | ||
const publicKey = cardano_serialization_lib_nodejs_1.PublicKey.from_bech32(vkey); | ||
const vkeyWitness = cardano_serialization_lib_nodejs_1.Vkeywitness.new(cardano_serialization_lib_nodejs_1.Vkey.new(publicKey), cardano_serialization_lib_nodejs_1.Ed25519Signature.from_hex(signature)); | ||
vkeyWitnesses.add(vkeyWitness); | ||
} | ||
} | ||
witnessSet.set_vkeys(vkeyWitnesses); | ||
return cardano_serialization_lib_nodejs_1.Transaction.new(_1.coreToCsl.txBody(body), witnessSet); | ||
}; | ||
exports.tx = tx; | ||
//# sourceMappingURL=coreToCsl.js.map |
@@ -0,3 +1,3 @@ | ||
import { Cardano } from '..'; | ||
import { CSL } from '.'; | ||
import { Cardano } from '..'; | ||
import { Transaction } from '@emurgo/cardano-serialization-lib-nodejs'; | ||
@@ -7,2 +7,4 @@ export declare const tx: (_input: Transaction) => Cardano.TxAlonzo; | ||
export declare const txIn: (input: CSL.TransactionInput, address: Cardano.Address) => Cardano.TxIn; | ||
export declare const txOut: (output: CSL.TransactionOutput) => Cardano.TxOut; | ||
export declare const txInputs: (inputs: CSL.TransactionInputs, address: Cardano.Address) => Cardano.TxIn[]; | ||
//# sourceMappingURL=cslToCore.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.txIn = exports.value = exports.tx = void 0; | ||
exports.txInputs = exports.txOut = exports.txIn = exports.value = exports.tx = void 0; | ||
const __1 = require(".."); | ||
@@ -35,7 +35,24 @@ const tx = (_input) => { | ||
const txIn = (input, address) => ({ | ||
txId: Buffer.from(input.transaction_id().to_bytes()).toString('hex'), | ||
address, | ||
index: input.index(), | ||
address | ||
txId: Buffer.from(input.transaction_id().to_bytes()).toString('hex') | ||
}); | ||
exports.txIn = txIn; | ||
const txOut = (output) => { | ||
const dataHashBytes = output.data_hash()?.to_bytes(); | ||
return { | ||
address: output.address().to_bech32(), | ||
datum: dataHashBytes ? Buffer.from(dataHashBytes).toString('hex') : undefined, | ||
value: exports.value(output.amount()) | ||
}; | ||
}; | ||
exports.txOut = txOut; | ||
const txInputs = (inputs, address) => { | ||
const result = []; | ||
for (let i = 0; i < inputs.len(); i++) { | ||
result.push(exports.txIn(inputs.get(i), address)); | ||
} | ||
return result; | ||
}; | ||
exports.txInputs = txInputs; | ||
//# sourceMappingURL=cslToCore.js.map |
@@ -13,2 +13,17 @@ import { CustomError } from 'ts-custom-error'; | ||
} | ||
export declare enum SerializationFailure { | ||
InvalidAddress = "INVALID_ADDRESS" | ||
} | ||
export declare class SerializationError extends CustomError { | ||
reason: SerializationFailure; | ||
detail?: string | undefined; | ||
innerError?: unknown; | ||
constructor(reason: SerializationFailure, detail?: string | undefined, innerError?: unknown); | ||
} | ||
export declare class InvalidProtocolParametersError extends CustomError { | ||
constructor(reason: string); | ||
} | ||
export declare class NotImplementedError extends CustomError { | ||
constructor(missingFeature: string); | ||
} | ||
//# sourceMappingURL=errors.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ProviderError = exports.ProviderFailure = void 0; | ||
exports.NotImplementedError = exports.InvalidProtocolParametersError = exports.SerializationError = exports.SerializationFailure = exports.ProviderError = exports.ProviderFailure = void 0; | ||
const ts_custom_error_1 = require("ts-custom-error"); | ||
@@ -11,5 +11,6 @@ var ProviderFailure; | ||
})(ProviderFailure = exports.ProviderFailure || (exports.ProviderFailure = {})); | ||
const formatMessage = (reason, detail) => reason + (detail ? ` (${detail})` : ''); | ||
class ProviderError extends ts_custom_error_1.CustomError { | ||
constructor(reason, innerError, detail) { | ||
super(reason + (detail ? ` (${detail})` : '')); | ||
super(formatMessage(reason, detail)); | ||
this.reason = reason; | ||
@@ -21,2 +22,27 @@ this.innerError = innerError; | ||
exports.ProviderError = ProviderError; | ||
var SerializationFailure; | ||
(function (SerializationFailure) { | ||
SerializationFailure["InvalidAddress"] = "INVALID_ADDRESS"; | ||
})(SerializationFailure = exports.SerializationFailure || (exports.SerializationFailure = {})); | ||
class SerializationError extends ts_custom_error_1.CustomError { | ||
constructor(reason, detail, innerError) { | ||
super(formatMessage(reason, detail)); | ||
this.reason = reason; | ||
this.detail = detail; | ||
this.innerError = innerError; | ||
} | ||
} | ||
exports.SerializationError = SerializationError; | ||
class InvalidProtocolParametersError extends ts_custom_error_1.CustomError { | ||
constructor(reason) { | ||
super(reason); | ||
} | ||
} | ||
exports.InvalidProtocolParametersError = InvalidProtocolParametersError; | ||
class NotImplementedError extends ts_custom_error_1.CustomError { | ||
constructor(missingFeature) { | ||
super(`Not implemented: ${missingFeature}`); | ||
} | ||
} | ||
exports.NotImplementedError = NotImplementedError; | ||
//# sourceMappingURL=errors.js.map |
@@ -0,4 +1,4 @@ | ||
export * as Address from './Address'; | ||
export * as Asset from './Asset'; | ||
export * as Cardano from './Cardano'; | ||
export * from './Genesis'; | ||
export * from './WalletProvider'; | ||
@@ -5,0 +5,0 @@ export * from './CSL'; |
@@ -25,6 +25,6 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Cardano = exports.Asset = void 0; | ||
exports.Cardano = exports.Asset = exports.Address = void 0; | ||
exports.Address = __importStar(require("./Address")); | ||
exports.Asset = __importStar(require("./Asset")); | ||
exports.Cardano = __importStar(require("./Cardano")); | ||
__exportStar(require("./Genesis"), exports); | ||
__exportStar(require("./WalletProvider"), exports); | ||
@@ -31,0 +31,0 @@ __exportStar(require("./CSL"), exports); |
export * from './BigIntMath'; | ||
export * from './errors'; | ||
export * as util from './misc'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -27,4 +27,3 @@ "use strict"; | ||
__exportStar(require("./BigIntMath"), exports); | ||
__exportStar(require("./errors"), exports); | ||
exports.util = __importStar(require("./misc")); | ||
//# sourceMappingURL=index.js.map |
export * from './replaceNullsToUndefineds'; | ||
export * from './isNotNil'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -14,2 +14,3 @@ "use strict"; | ||
__exportStar(require("./replaceNullsToUndefineds"), exports); | ||
__exportStar(require("./isNotNil"), exports); | ||
//# sourceMappingURL=index.js.map |
@@ -1,3 +0,3 @@ | ||
import { CSL, Cardano } from '..'; | ||
export declare type ProtocolParametersRequiredByWallet = Pick<Cardano.ProtocolParametersAlonzo, 'coinsPerUtxoWord' | 'maxTxSize' | 'maxValueSize' | 'stakeKeyDeposit' | 'maxCollateralInputs' | 'minFeeCoefficient' | 'minFeeConstant' | 'minPoolCost' | 'poolDeposit' | 'protocolVersion'>; | ||
import { Cardano } from '..'; | ||
export declare type ProtocolParametersRequiredByWallet = Required<Pick<Cardano.ProtocolParametersAlonzo, 'coinsPerUtxoWord' | 'maxTxSize' | 'maxValueSize' | 'stakeKeyDeposit' | 'maxCollateralInputs' | 'minFeeCoefficient' | 'minFeeConstant' | 'minPoolCost' | 'poolDeposit' | 'protocolVersion'>>; | ||
export declare type AssetSupply = { | ||
@@ -32,2 +32,14 @@ circulating: Cardano.Lovelace; | ||
}; | ||
export interface EpochRange { | ||
lowerBound?: Cardano.Epoch; | ||
upperBound?: Cardano.Epoch; | ||
} | ||
export interface RewardHistoryProps { | ||
stakeAddresses: Cardano.Address[]; | ||
epochs?: EpochRange; | ||
} | ||
export interface EpochRewards { | ||
epoch: Cardano.Epoch; | ||
rewards: Cardano.Lovelace; | ||
} | ||
export interface WalletProvider { | ||
@@ -37,11 +49,14 @@ ledgerTip: () => Promise<Cardano.Tip>; | ||
stakePoolStats?: () => Promise<StakePoolStats>; | ||
submitTx: (signedTransaction: CSL.Transaction) => Promise<void>; | ||
utxoDelegationAndRewards: (addresses: Cardano.Address[], stakeKeyHash: Cardano.Hash16) => Promise<{ | ||
submitTx: (signedTransaction: Uint8Array) => Promise<void>; | ||
utxoDelegationAndRewards: (addresses: Cardano.Address[], rewardAccount?: Cardano.Address) => Promise<{ | ||
utxo: Cardano.Utxo[]; | ||
delegationAndRewards: Cardano.DelegationsAndRewards; | ||
delegationAndRewards?: Cardano.DelegationsAndRewards; | ||
}>; | ||
queryTransactionsByAddresses: (addresses: Cardano.Address[]) => Promise<Cardano.TxAlonzo[]>; | ||
queryTransactionsByHashes: (hashes: Cardano.Hash16[]) => Promise<Cardano.TxAlonzo[]>; | ||
queryBlocksByHashes: (hashes: Cardano.Hash16[]) => Promise<Cardano.Block[]>; | ||
currentWalletProtocolParameters: () => Promise<ProtocolParametersRequiredByWallet>; | ||
genesisParameters: () => Promise<Cardano.CompactGenesis>; | ||
rewardsHistory: (props: RewardHistoryProps) => Promise<EpochRewards[]>; | ||
} | ||
//# sourceMappingURL=types.d.ts.map |
{ | ||
"name": "@cardano-sdk/core", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"description": "Core types and libraries for Cardano", | ||
@@ -17,2 +17,3 @@ "engines": { | ||
"lint": "eslint --ignore-path ../../.eslintignore \"**/*.ts\"", | ||
"lint:fix": "eslint --fix --ignore-path ../../.eslintignore \"**/*.ts\"", | ||
"test": "jest -c ./jest.config.js", | ||
@@ -23,3 +24,3 @@ "coverage": "shx echo No coverage report for this package", | ||
"devDependencies": { | ||
"@cardano-sdk/util-dev": "0.1.5", | ||
"@cardano-sdk/util-dev": " 0.1.6", | ||
"shx": "^0.3.3" | ||
@@ -26,0 +27,0 @@ }, |
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 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 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 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 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 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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
106432
1172
0
140