@cardano-sdk/cardano-graphql-db-sync
Advanced tools
Comparing version 0.1.5 to 0.1.6
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.cardanoGraphqlDbSyncProvider = void 0; | ||
const core_1 = require("@cardano-sdk/core"); | ||
const graphql_request_1 = require("graphql-request"); | ||
const buffer_1 = require("buffer"); | ||
const CardanoGraphqlToCore_1 = require("./CardanoGraphqlToCore"); | ||
const graphql_request_1 = require("graphql-request"); | ||
const core_1 = require("@cardano-sdk/core"); | ||
const cardanoGraphqlDbSyncProvider = (uri) => { | ||
@@ -142,3 +142,3 @@ const client = new graphql_request_1.GraphQLClient(uri); | ||
const response = await client.request(mutation, { | ||
transaction: buffer_1.Buffer.from(signedTransaction.to_bytes()).toString('hex') | ||
transaction: buffer_1.Buffer.from(signedTransaction).toString('hex') | ||
}); | ||
@@ -154,4 +154,13 @@ if (!response.hash) { | ||
const utxoDelegationAndRewards = async () => { | ||
throw new Error('Not implemented yet.'); | ||
throw new core_1.ProviderError(core_1.ProviderFailure.NotImplemented); | ||
}; | ||
const rewardsHistory = async () => { | ||
throw new core_1.ProviderError(core_1.ProviderFailure.NotImplemented); | ||
}; | ||
const genesisParameters = async () => { | ||
throw new core_1.ProviderError(core_1.ProviderFailure.NotImplemented); | ||
}; | ||
const queryBlocksByHashes = async () => { | ||
throw new core_1.ProviderError(core_1.ProviderFailure.NotImplemented); | ||
}; | ||
const queryTransactionsByAddresses = async (addresses) => { | ||
@@ -235,10 +244,13 @@ const query = graphql_request_1.gql ` | ||
return { | ||
currentWalletProtocolParameters, | ||
genesisParameters, | ||
ledgerTip, | ||
networkInfo, | ||
queryBlocksByHashes, | ||
queryTransactionsByAddresses, | ||
queryTransactionsByHashes, | ||
rewardsHistory, | ||
stakePoolStats, | ||
submitTx, | ||
utxoDelegationAndRewards, | ||
queryTransactionsByAddresses, | ||
queryTransactionsByHashes, | ||
currentWalletProtocolParameters | ||
utxoDelegationAndRewards | ||
}; | ||
@@ -245,0 +257,0 @@ }; |
@@ -1,3 +0,3 @@ | ||
import { ProtocolParametersRequiredByWallet, Cardano } from '@cardano-sdk/core'; | ||
import { Block } from '@cardano-graphql/client-ts'; | ||
import { Cardano, ProtocolParametersRequiredByWallet } from '@cardano-sdk/core'; | ||
declare type GraphqlTransaction = { | ||
@@ -59,2 +59,5 @@ hash: Cardano.Hash16; | ||
export declare const CardanoGraphqlToCore: { | ||
currentWalletProtocolParameters: (params: GraphqlCurrentWalletProtocolParameters) => ProtocolParametersRequiredByWallet; | ||
graphqlTransactionsToCardanoTxs: (_transactions: TransactionsResponse) => Cardano.TxAlonzo[]; | ||
tip: (tip: CardanoGraphQlTip) => Cardano.Tip; | ||
txIn: ({ sourceTxIndex, txHash, address }: GraphqlTransaction['inputs'][0]) => Cardano.TxIn; | ||
@@ -64,13 +67,10 @@ txOut: ({ address, tokens, value }: GraphqlTransaction['outputs'][0]) => { | ||
value: { | ||
coins: bigint; | ||
assets: { | ||
[k: string]: bigint; | ||
}; | ||
coins: bigint; | ||
}; | ||
}; | ||
graphqlTransactionsToCardanoTxs: (_transactions: TransactionsResponse) => Cardano.TxAlonzo[]; | ||
currentWalletProtocolParameters: (params: GraphqlCurrentWalletProtocolParameters) => ProtocolParametersRequiredByWallet; | ||
tip: (tip: CardanoGraphQlTip) => Cardano.Tip; | ||
}; | ||
export {}; | ||
//# sourceMappingURL=CardanoGraphqlToCore.d.ts.map |
@@ -6,5 +6,5 @@ "use strict"; | ||
const txIn = ({ sourceTxIndex, txHash, address }) => ({ | ||
txId: txHash, | ||
address, | ||
index: sourceTxIndex, | ||
address | ||
txId: txHash | ||
}); | ||
@@ -15,18 +15,16 @@ const txOut = ({ address, tokens, value }) => { | ||
assets[token.asset.assetId] = BigInt(token.quantity); | ||
return { address, value: { coins: BigInt(value), assets } }; | ||
return { address, value: { assets, coins: BigInt(value) } }; | ||
}; | ||
exports.CardanoGraphqlToCore = { | ||
txIn, | ||
txOut, | ||
graphqlTransactionsToCardanoTxs: (_transactions) => { | ||
throw new core_1.NotImplementedError('Need to query more data to support this'); | ||
}, | ||
currentWalletProtocolParameters: (params) => ({ | ||
...params, | ||
maxTxSize: params.maxTxSize, | ||
maxValueSize: Number(params.maxValSize), | ||
stakeKeyDeposit: params.keyDeposit, | ||
maxTxSize: params.maxTxSize, | ||
minFeeCoefficient: params.minFeeA, | ||
minFeeConstant: params.minFeeB | ||
minFeeConstant: params.minFeeB, | ||
stakeKeyDeposit: params.keyDeposit | ||
}), | ||
graphqlTransactionsToCardanoTxs: (_transactions) => { | ||
throw new core_1.NotImplementedError('Need to query more data to support this'); | ||
}, | ||
tip: (tip) => ({ | ||
@@ -36,4 +34,6 @@ blockNo: tip.number, | ||
slot: tip.slotNo | ||
}) | ||
}), | ||
txIn, | ||
txOut | ||
}; | ||
//# sourceMappingURL=CardanoGraphqlToCore.js.map |
{ | ||
"name": "@cardano-sdk/cardano-graphql-db-sync", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"description": "Cardano Graphql (cardano-db-sync) integration", | ||
@@ -18,2 +18,3 @@ "engines": { | ||
"lint": "eslint --ignore-path ../../.eslintignore \"**/*.ts\"", | ||
"lint:fix": "eslint --fix --ignore-path ../../.eslintignore \"**/*.ts\"", | ||
"test": "jest -c ./jest.config.js", | ||
@@ -20,0 +21,0 @@ "coverage": "shx echo No coverage report for this package", |
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
32762
380
0