Skip to content

feat(dapi): add totalCreditsInPlatform endpoint #2051

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 35 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
ea2a5ad
start work
QuantumExplorer Aug 1, 2024
78964fc
cleanup
QuantumExplorer Aug 1, 2024
deb7ceb
more work
QuantumExplorer Aug 2, 2024
456149e
total credits on platform
QuantumExplorer Aug 2, 2024
a360569
added JS dapi client for get total credits on platform
QuantumExplorer Aug 2, 2024
276e75f
dealth with core subsidy issue
QuantumExplorer Aug 4, 2024
c16685e
fmt
QuantumExplorer Aug 4, 2024
1f10ed5
fixes
QuantumExplorer Aug 4, 2024
461bc1b
work on subsidy
QuantumExplorer Aug 4, 2024
2ffb6d7
more work
QuantumExplorer Aug 4, 2024
7db6c30
small fix
QuantumExplorer Aug 5, 2024
3c41e7e
chore: pass network option to Drive ABCI (#2037)
shumkov Aug 5, 2024
edde351
fix: invalid network alias deserializer
shumkov Aug 5, 2024
6a28efd
chore(dashmate): set epoch time 20 mins for local
shumkov Aug 5, 2024
345d1f0
more fixes
QuantumExplorer Aug 5, 2024
845550a
updated sdk
QuantumExplorer Aug 5, 2024
32c4fa4
Merge branch 'feat/totalCreditsOnPlatformQuery' of github.com:dashpay…
QuantumExplorer Aug 5, 2024
5b5ebe8
fixes
QuantumExplorer Aug 5, 2024
0c709ab
fixes
QuantumExplorer Aug 5, 2024
bc606d7
more work
QuantumExplorer Aug 7, 2024
7f1b86a
Merge branch 'v1.1-dev' into feat/totalCreditsOnPlatformQuery
QuantumExplorer Aug 7, 2024
c9a8857
more fixes
QuantumExplorer Aug 7, 2024
8f00f99
version working
QuantumExplorer Aug 7, 2024
6742e55
set to mainnet
QuantumExplorer Aug 8, 2024
a25cdb8
another fix
QuantumExplorer Aug 12, 2024
b70c5bd
initial commit
owl352 Aug 12, 2024
f1d1209
names fix
owl352 Aug 12, 2024
4e66480
Merge branch 'v1.1-dev' into feat/totalCreditsOnPlatformQuery
pshenmic Aug 14, 2024
9371b87
fix response
owl352 Aug 14, 2024
14a8ea7
names fix
owl352 Aug 14, 2024
27ea677
name fix
owl352 Aug 14, 2024
36ad576
names fix
owl352 Aug 14, 2024
f7a4063
facade fix
owl352 Aug 14, 2024
be5db01
Merge remote-tracking branch 'dashpay/v1.1-dev' into feat/totalCredit…
owl352 Aug 14, 2024
258cfb2
fix response
owl352 Aug 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@
GetIdentityNonceResponse: PBJSGetIdentityNonceResponse,
GetIdentityKeysRequest: PBJSGetIdentityKeysRequest,
GetIdentityKeysResponse: PBJSGetIdentityKeysResponse,
GetTotalCreditsInPlatformRequest: PBJSGetTotalCreditsInPlatformRequest,
GetTotalCreditsInPlatformResponse: PBJSGetTotalCreditsInPlatformResponse

Check failure on line 62 in packages/dapi-grpc/clients/platform/v0/nodejs/PlatformPromiseClient.js

View workflow job for this annotation

GitHub Actions / JS packages (@dashevo/dapi-grpc) / Linting

Missing trailing comma
},
},
},
Expand All @@ -82,6 +84,7 @@
GetIdentityContractNonceResponse: ProtocGetIdentityContractNonceResponse,
GetIdentityNonceResponse: ProtocGetIdentityNonceResponse,
GetIdentityKeysResponse: ProtocGetIdentityKeysResponse,
GetTotalCreditsInPlatformResponse: ProtocGetTotalCreditsInPlatformResponse

Check failure on line 87 in packages/dapi-grpc/clients/platform/v0/nodejs/PlatformPromiseClient.js

View workflow job for this annotation

GitHub Actions / JS packages (@dashevo/dapi-grpc) / Linting

Missing trailing comma
} = require('./platform_protoc');

const getPlatformDefinition = require('../../../../lib/getPlatformDefinition');
Expand Down Expand Up @@ -172,6 +175,10 @@
this.client.getIdentityKeys.bind(this.client),
);

this.client.getTotalCreditsInPlatform = promisify(
this.client.getTotalCreditsInPlatform.bind(this.client),
);

this.protocolVersion = undefined;
}

Expand Down Expand Up @@ -690,6 +697,36 @@
);
}

getTotalCreditsInPlatform(
getTotalCreditsInPlatformRequest,
metadata = {},
options = {},
) {
if (!isObject(metadata)) {
throw new Error('metadata must be an object');
}

return this.client.getTotalCreditsInPlatform(
getTotalCreditsInPlatformRequest,
convertObjectToMetadata(metadata),
{
interceptors: [
jsonToProtobufInterceptorFactory(
jsonToProtobufFactory(
ProtocGetTotalCreditsInPlatformResponse,
PBJSGetTotalCreditsInPlatformResponse,
),
protobufToJsonFactory(
PBJSGetTotalCreditsInPlatformRequest,
),
),
],
...options,
},
);
}


Check failure on line 729 in packages/dapi-grpc/clients/platform/v0/nodejs/PlatformPromiseClient.js

View workflow job for this annotation

GitHub Actions / JS packages (@dashevo/dapi-grpc) / Linting

More than 1 blank line not allowed
/**
* @param {string} protocolVersion
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
const getIdentityContractNonceFactory = require('./getIdentityContractNonce/getIdentityContractNonceFactory');
const getIdentityNonceFactory = require('./getIdentityNonce/getIdentityNonceFactory');
const getIdentityKeysFactory = require('./getIdentityKeys/getIdentityKeysFactory');
const getTotalCreditsInPlatformFactory = require('./getTotalCreditsInPlatform/getTotalCreditsInPlatformFactory')

Check failure on line 16 in packages/js-dapi-client/lib/methods/platform/PlatformMethodsFacade.js

View workflow job for this annotation

GitHub Actions / JS packages (@dashevo/dapi-client) / Linting

Missing semicolon

class PlatformMethodsFacade {
/**
Expand All @@ -36,6 +37,7 @@
this.getIdentityContractNonce = getIdentityContractNonceFactory(grpcTransport);
this.getIdentityNonce = getIdentityNonceFactory(grpcTransport);
this.getIdentityKeys = getIdentityKeysFactory(grpcTransport);
this.getTotalCreditsInPlatform = getTotalCreditsInPlatformFactory(grpcTransport)

Check failure on line 40 in packages/js-dapi-client/lib/methods/platform/PlatformMethodsFacade.js

View workflow job for this annotation

GitHub Actions / JS packages (@dashevo/dapi-client) / Linting

Missing semicolon
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class GetTotalCreditsInPlatformResponse extends AbstractResponse {
*/
static createFromProto(proto) {
// eslint-disable-next-line
const totalCreditsInPlatform = proto.getV0().getTotalCreditsInPlatform();
const totalCreditsInPlatform = proto.getV0().getCredits();
const { metadata, proof } = AbstractResponse.createMetadataAndProofFromProto(
proto,
);
Expand Down
Loading