@dashevo/dapi-grpc 2.0.0-rc.12 → 2.0.0-rc.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Cargo.toml +1 -1
- package/build.rs +4 -2
- package/clients/drive/v0/nodejs/drive_pbjs.js +1318 -152
- package/clients/platform/v0/nodejs/platform_pbjs.js +1318 -152
- package/clients/platform/v0/nodejs/platform_protoc.js +1217 -105
- package/clients/platform/v0/web/platform_pb.d.ts +174 -25
- package/clients/platform/v0/web/platform_pb.js +1217 -105
- package/clients/platform/v0/web/platform_pb_service.d.ts +19 -0
- package/clients/platform/v0/web/platform_pb_service.js +40 -0
- package/package.json +2 -2
- package/protos/platform/v0/platform.proto +64 -16
|
@@ -346,6 +346,15 @@ type PlatformgetTokenDirectPurchasePrices = {
|
|
|
346
346
|
readonly responseType: typeof platform_pb.GetTokenDirectPurchasePricesResponse;
|
|
347
347
|
};
|
|
348
348
|
|
|
349
|
+
type PlatformgetTokenContractInfo = {
|
|
350
|
+
readonly methodName: string;
|
|
351
|
+
readonly service: typeof Platform;
|
|
352
|
+
readonly requestStream: false;
|
|
353
|
+
readonly responseStream: false;
|
|
354
|
+
readonly requestType: typeof platform_pb.GetTokenContractInfoRequest;
|
|
355
|
+
readonly responseType: typeof platform_pb.GetTokenContractInfoResponse;
|
|
356
|
+
};
|
|
357
|
+
|
|
349
358
|
type PlatformgetTokenPreProgrammedDistributions = {
|
|
350
359
|
readonly methodName: string;
|
|
351
360
|
readonly service: typeof Platform;
|
|
@@ -449,6 +458,7 @@ export class Platform {
|
|
|
449
458
|
static readonly getIdentitiesTokenInfos: PlatformgetIdentitiesTokenInfos;
|
|
450
459
|
static readonly getTokenStatuses: PlatformgetTokenStatuses;
|
|
451
460
|
static readonly getTokenDirectPurchasePrices: PlatformgetTokenDirectPurchasePrices;
|
|
461
|
+
static readonly getTokenContractInfo: PlatformgetTokenContractInfo;
|
|
452
462
|
static readonly getTokenPreProgrammedDistributions: PlatformgetTokenPreProgrammedDistributions;
|
|
453
463
|
static readonly getTokenPerpetualDistributionLastClaim: PlatformgetTokenPerpetualDistributionLastClaim;
|
|
454
464
|
static readonly getTokenTotalSupply: PlatformgetTokenTotalSupply;
|
|
@@ -832,6 +842,15 @@ export class PlatformClient {
|
|
|
832
842
|
requestMessage: platform_pb.GetTokenDirectPurchasePricesRequest,
|
|
833
843
|
callback: (error: ServiceError|null, responseMessage: platform_pb.GetTokenDirectPurchasePricesResponse|null) => void
|
|
834
844
|
): UnaryResponse;
|
|
845
|
+
getTokenContractInfo(
|
|
846
|
+
requestMessage: platform_pb.GetTokenContractInfoRequest,
|
|
847
|
+
metadata: grpc.Metadata,
|
|
848
|
+
callback: (error: ServiceError|null, responseMessage: platform_pb.GetTokenContractInfoResponse|null) => void
|
|
849
|
+
): UnaryResponse;
|
|
850
|
+
getTokenContractInfo(
|
|
851
|
+
requestMessage: platform_pb.GetTokenContractInfoRequest,
|
|
852
|
+
callback: (error: ServiceError|null, responseMessage: platform_pb.GetTokenContractInfoResponse|null) => void
|
|
853
|
+
): UnaryResponse;
|
|
835
854
|
getTokenPreProgrammedDistributions(
|
|
836
855
|
requestMessage: platform_pb.GetTokenPreProgrammedDistributionsRequest,
|
|
837
856
|
metadata: grpc.Metadata,
|
|
@@ -352,6 +352,15 @@ Platform.getTokenDirectPurchasePrices = {
|
|
|
352
352
|
responseType: platform_pb.GetTokenDirectPurchasePricesResponse
|
|
353
353
|
};
|
|
354
354
|
|
|
355
|
+
Platform.getTokenContractInfo = {
|
|
356
|
+
methodName: "getTokenContractInfo",
|
|
357
|
+
service: Platform,
|
|
358
|
+
requestStream: false,
|
|
359
|
+
responseStream: false,
|
|
360
|
+
requestType: platform_pb.GetTokenContractInfoRequest,
|
|
361
|
+
responseType: platform_pb.GetTokenContractInfoResponse
|
|
362
|
+
};
|
|
363
|
+
|
|
355
364
|
Platform.getTokenPreProgrammedDistributions = {
|
|
356
365
|
methodName: "getTokenPreProgrammedDistributions",
|
|
357
366
|
service: Platform,
|
|
@@ -1600,6 +1609,37 @@ PlatformClient.prototype.getTokenDirectPurchasePrices = function getTokenDirectP
|
|
|
1600
1609
|
};
|
|
1601
1610
|
};
|
|
1602
1611
|
|
|
1612
|
+
PlatformClient.prototype.getTokenContractInfo = function getTokenContractInfo(requestMessage, metadata, callback) {
|
|
1613
|
+
if (arguments.length === 2) {
|
|
1614
|
+
callback = arguments[1];
|
|
1615
|
+
}
|
|
1616
|
+
var client = grpc.unary(Platform.getTokenContractInfo, {
|
|
1617
|
+
request: requestMessage,
|
|
1618
|
+
host: this.serviceHost,
|
|
1619
|
+
metadata: metadata,
|
|
1620
|
+
transport: this.options.transport,
|
|
1621
|
+
debug: this.options.debug,
|
|
1622
|
+
onEnd: function (response) {
|
|
1623
|
+
if (callback) {
|
|
1624
|
+
if (response.status !== grpc.Code.OK) {
|
|
1625
|
+
var err = new Error(response.statusMessage);
|
|
1626
|
+
err.code = response.status;
|
|
1627
|
+
err.metadata = response.trailers;
|
|
1628
|
+
callback(err, null);
|
|
1629
|
+
} else {
|
|
1630
|
+
callback(null, response.message);
|
|
1631
|
+
}
|
|
1632
|
+
}
|
|
1633
|
+
}
|
|
1634
|
+
});
|
|
1635
|
+
return {
|
|
1636
|
+
cancel: function () {
|
|
1637
|
+
callback = null;
|
|
1638
|
+
client.close();
|
|
1639
|
+
}
|
|
1640
|
+
};
|
|
1641
|
+
};
|
|
1642
|
+
|
|
1603
1643
|
PlatformClient.prototype.getTokenPreProgrammedDistributions = function getTokenPreProgrammedDistributions(requestMessage, metadata, callback) {
|
|
1604
1644
|
if (arguments.length === 2) {
|
|
1605
1645
|
callback = arguments[1];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dashevo/dapi-grpc",
|
|
3
|
-
"version": "2.0.0-rc.
|
|
3
|
+
"version": "2.0.0-rc.13",
|
|
4
4
|
"description": "DAPI GRPC definition file and generated clients",
|
|
5
5
|
"browser": "browser.js",
|
|
6
6
|
"main": "node.js",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
},
|
|
46
46
|
"homepage": "https://github.com/dashevo/dapi-grpc#readme",
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@dashevo/grpc-common": "2.0.0-rc.
|
|
48
|
+
"@dashevo/grpc-common": "2.0.0-rc.13",
|
|
49
49
|
"@dashevo/protobufjs": "6.10.5",
|
|
50
50
|
"@grpc/grpc-js": "1.4.4",
|
|
51
51
|
"@improbable-eng/grpc-web": "^0.15.0",
|
|
@@ -86,6 +86,8 @@ service Platform {
|
|
|
86
86
|
returns (GetTokenStatusesResponse);
|
|
87
87
|
rpc getTokenDirectPurchasePrices(GetTokenDirectPurchasePricesRequest)
|
|
88
88
|
returns (GetTokenDirectPurchasePricesResponse);
|
|
89
|
+
rpc getTokenContractInfo(GetTokenContractInfoRequest)
|
|
90
|
+
returns (GetTokenContractInfoResponse);
|
|
89
91
|
rpc getTokenPreProgrammedDistributions(
|
|
90
92
|
GetTokenPreProgrammedDistributionsRequest)
|
|
91
93
|
returns (GetTokenPreProgrammedDistributionsResponse);
|
|
@@ -1370,6 +1372,27 @@ message GetTokenStatusesResponse {
|
|
|
1370
1372
|
oneof version { GetTokenStatusesResponseV0 v0 = 1; }
|
|
1371
1373
|
}
|
|
1372
1374
|
|
|
1375
|
+
// Retrieve direct purchase prices defined for one or more tokens.
|
|
1376
|
+
//
|
|
1377
|
+
// Some tokens can have a direct purchase price defined using
|
|
1378
|
+
// `TokenSetPriceForDirectPurchaseTransition` (see `dpp` crate for details).
|
|
1379
|
+
// This request retrieves the direct purchase prices for those tokens and
|
|
1380
|
+
// returns [GetTokenDirectPurchasePricesResponse].
|
|
1381
|
+
message GetTokenDirectPurchasePricesRequest {
|
|
1382
|
+
message GetTokenDirectPurchasePricesRequestV0 {
|
|
1383
|
+
// List of token IDs to get prices for.
|
|
1384
|
+
//
|
|
1385
|
+
// The list must not be empty.
|
|
1386
|
+
// Token IDs must have 32 bytes and be unique.
|
|
1387
|
+
// Results for non-unique token IDs are undefined.
|
|
1388
|
+
repeated bytes token_ids = 1;
|
|
1389
|
+
// Whether to return proofs for the response, or just direct response.
|
|
1390
|
+
bool prove = 2;
|
|
1391
|
+
}
|
|
1392
|
+
oneof version { GetTokenDirectPurchasePricesRequestV0 v0 = 1; }
|
|
1393
|
+
}
|
|
1394
|
+
|
|
1395
|
+
|
|
1373
1396
|
// Response to GetTokenDirectPurchasePricesRequest, containing information about
|
|
1374
1397
|
// direct purchase prices defined for requested token IDs.
|
|
1375
1398
|
message GetTokenDirectPurchasePricesResponse {
|
|
@@ -1419,24 +1442,49 @@ message GetTokenDirectPurchasePricesResponse {
|
|
|
1419
1442
|
oneof version { GetTokenDirectPurchasePricesResponseV0 v0 = 1; }
|
|
1420
1443
|
}
|
|
1421
1444
|
|
|
1422
|
-
//
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
//
|
|
1426
|
-
//
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
// List of token IDs to get prices for.
|
|
1431
|
-
//
|
|
1432
|
-
// The list must not be empty.
|
|
1433
|
-
// Token IDs must have 32 bytes and be unique.
|
|
1434
|
-
// Results for non-unique token IDs are undefined.
|
|
1435
|
-
repeated bytes token_ids = 1;
|
|
1436
|
-
// Whether to return proofs for the response, or just direct response.
|
|
1445
|
+
// Request to retrieve token contract info for a specific token ID.
|
|
1446
|
+
message GetTokenContractInfoRequest {
|
|
1447
|
+
message GetTokenContractInfoRequestV0 {
|
|
1448
|
+
// The token ID to retrieve contract info for.
|
|
1449
|
+
// Must be exactly 32 bytes.
|
|
1450
|
+
bytes token_id = 1;
|
|
1451
|
+
|
|
1452
|
+
// Whether to return a cryptographic proof.
|
|
1437
1453
|
bool prove = 2;
|
|
1438
1454
|
}
|
|
1439
|
-
|
|
1455
|
+
|
|
1456
|
+
oneof version {
|
|
1457
|
+
GetTokenContractInfoRequestV0 v0 = 1;
|
|
1458
|
+
}
|
|
1459
|
+
}
|
|
1460
|
+
|
|
1461
|
+
// Response to GetTokenContractInfoRequest.
|
|
1462
|
+
message GetTokenContractInfoResponse {
|
|
1463
|
+
message GetTokenContractInfoResponseV0 {
|
|
1464
|
+
// Direct token contract info.
|
|
1465
|
+
message TokenContractInfoData {
|
|
1466
|
+
// The ID of the contract associated with the token.
|
|
1467
|
+
bytes contract_id = 1;
|
|
1468
|
+
|
|
1469
|
+
// The position of the token within the contract.
|
|
1470
|
+
uint32 token_contract_position = 2;
|
|
1471
|
+
}
|
|
1472
|
+
|
|
1473
|
+
oneof result {
|
|
1474
|
+
// Direct token contract data
|
|
1475
|
+
TokenContractInfoData data = 1;
|
|
1476
|
+
|
|
1477
|
+
// Cryptographic proof of token contract info
|
|
1478
|
+
Proof proof = 2;
|
|
1479
|
+
}
|
|
1480
|
+
|
|
1481
|
+
// Metadata about the blockchain state at the time of the query
|
|
1482
|
+
ResponseMetadata metadata = 3;
|
|
1483
|
+
}
|
|
1484
|
+
|
|
1485
|
+
oneof version {
|
|
1486
|
+
GetTokenContractInfoResponseV0 v0 = 1;
|
|
1487
|
+
}
|
|
1440
1488
|
}
|
|
1441
1489
|
|
|
1442
1490
|
message GetTokenPreProgrammedDistributionsRequest {
|