File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -3,14 +3,12 @@ import {TokenClient} from '../src';
3
3
/**
4
4
* Imports and sets up the SDK, and creates a Token member with the MemoryCryptoEngine
5
5
* (which will store keys in memory).
6
- * @param {string } developerKey - developer key
7
6
* @return {Member } created member
8
7
*/
9
- export default async developerKey => {
8
+ export default async ( ) => {
10
9
// Initialize SDK:
11
10
const Token = new TokenClient ( {
12
11
env : 'sandbox' ,
13
- developerKey,
14
12
keyDir : './keys' ,
15
13
} ) ;
16
14
Original file line number Diff line number Diff line change @@ -14,19 +14,19 @@ class RedeemAccessTokenSample {
14
14
*/
15
15
static async use ( grantee , tokenId ) {
16
16
// 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
18
18
// forAccessToken snippet begin
19
- const grantor = grantee . forAccessToken ( tokenId ) ;
19
+ const representative = grantee . forAccessToken ( tokenId ) ;
20
20
let accounts ;
21
21
try {
22
- accounts = await grantor . getAccounts ( ) ;
22
+ accounts = await representative . getAccounts ( ) ;
23
23
} catch ( e ) {
24
24
// no access (e.g. grantor unlinked accounts or revoked access)
25
25
return { } ;
26
26
}
27
27
28
28
// 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 ) ;
30
30
// forAccessToken snippet end
31
31
32
32
return balance0 . current ;
You can’t perform that action at this time.
0 commit comments