@concordium/node-sdk
Advanced tools
Comparing version 5.0.0 to 6.0.0
@@ -61,3 +61,3 @@ /// <reference types="node" /> | ||
*/ | ||
getAccountInfo(accountAddress: Address | CredentialRegistrationId, blockHash: string): Promise<AccountInfo | undefined>; | ||
getAccountInfo(accountAddress: string | Address | CredentialRegistrationId, blockHash: string): Promise<AccountInfo | undefined>; | ||
/** | ||
@@ -64,0 +64,0 @@ * Retrieves the next account nonce for the given account. The account nonce is |
@@ -87,8 +87,14 @@ "use strict"; | ||
const getAddressInfoRequest = new concordium_p2p_rpc_pb_1.GetAddressInfoRequest(); | ||
if (accountAddress instanceof common_sdk_1.AccountAddress) { | ||
if (typeof accountAddress === 'string') { | ||
getAddressInfoRequest.setAddress(accountAddress); | ||
} | ||
else if ('address' in accountAddress) { | ||
getAddressInfoRequest.setAddress(accountAddress.address); | ||
} | ||
else { | ||
else if ('credId' in accountAddress) { | ||
getAddressInfoRequest.setAddress(accountAddress.credId); | ||
} | ||
else { | ||
throw new Error('Invalid accountAddress input'); | ||
} | ||
getAddressInfoRequest.setBlockHash(blockHash); | ||
@@ -343,3 +349,3 @@ const response = await this.sendRequest(this.client.getAccountInfo, getAddressInfoRequest); | ||
const common = { | ||
amount: new common_sdk_1.GtuAmount(BigInt(result.amount)), | ||
amount: new common_sdk_1.CcdAmount(BigInt(result.amount)), | ||
sourceModule: new common_sdk_1.ModuleReference(result.sourceModule), | ||
@@ -474,3 +480,3 @@ owner: new common_sdk_1.AccountAddress(result.owner), | ||
amount: contractContext.amount && | ||
contractContext.amount.microGtuAmount.toString(), | ||
contractContext.amount.microCcdAmount.toString(), | ||
method: contractContext.method, | ||
@@ -477,0 +483,0 @@ parameter: contractContext.parameter && |
{ | ||
"name": "@concordium/node-sdk", | ||
"version": "5.0.0", | ||
"version": "6.0.0", | ||
"description": "Helpers for interacting with the Concordium node", | ||
@@ -58,3 +58,3 @@ "repository": { | ||
"dependencies": { | ||
"@concordium/common-sdk": "5.2.0", | ||
"@concordium/common-sdk": "6.0.0", | ||
"@grpc/grpc-js": "^1.3.4", | ||
@@ -61,0 +61,0 @@ "buffer": "^6.0.3", |
381754
7486
+ Added@concordium/common-sdk@6.0.0(transitive)
+ Added@concordium/rust-bindings@0.7.0(transitive)
- Removed@concordium/common-sdk@5.2.0(transitive)
- Removed@concordium/rust-bindings@0.6.0(transitive)
Updated@concordium/common-sdk@6.0.0