Skip to content

Commit dd2c20e

Browse files
author
Harry Jian
authored
Sample fixes (#217)
1 parent 79c3d4d commit dd2c20e

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

new-sdks/tpp/sample/PersistentlyCreateMemberSample.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@ import {TokenClient} from '../src';
33
/**
44
* Imports and sets up the SDK, and creates a Token member with the MemoryCryptoEngine
55
* (which will store keys in memory).
6-
* @param {string} developerKey - developer key
76
* @return {Member} created member
87
*/
9-
export default async developerKey => {
8+
export default async () => {
109
// Initialize SDK:
1110
const Token = new TokenClient({
1211
env: 'sandbox',
13-
developerKey,
1412
keyDir: './keys',
1513
});
1614

new-sdks/tpp/sample/RedeemAccessTokenSample.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@ class RedeemAccessTokenSample {
1414
*/
1515
static async use(grantee, tokenId) {
1616
// Use the access token, now making API calls
17-
// on behalf of the grantor, and get accounts
17+
// on behalf of the grantor (as a representative), and get accounts
1818
// forAccessToken snippet begin
19-
const grantor = grantee.forAccessToken(tokenId);
19+
const representative = grantee.forAccessToken(tokenId);
2020
let accounts;
2121
try {
22-
accounts = await grantor.getAccounts();
22+
accounts = await representative.getAccounts();
2323
} catch (e) {
2424
// no access (e.g. grantor unlinked accounts or revoked access)
2525
return {};
2626
}
2727

2828
// Get information we want:
29-
const balance0 = await grantor.getBalance(accounts[0].id(), config.KeyLevel.LOW);
29+
const balance0 = await representative.getBalance(accounts[0].id(), config.KeyLevel.LOW);
3030
// forAccessToken snippet end
3131

3232
return balance0.current;

0 commit comments

Comments
 (0)