generated from jasonsturges/typescript-npm-package
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(SPV-999): SharedConfig type is not representing server response c…
…orrectly. (#1069)
- Loading branch information
1 parent
7d0664f
commit 2d3e908
Showing
4 changed files
with
25 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { SpvWalletClient } from '../dist/typescript-npm-package.cjs.js'; | ||
import { exampleAdminKey, exampleXPriv } from './example-keys.js'; | ||
import { errMessage } from './utils.js'; | ||
|
||
const server = 'http://localhost:3003/v1'; | ||
|
||
// It is possible to get paymail domains either as an admin or as a user. | ||
if (!exampleAdminKey && !exampleXPriv) { | ||
console.log(errMessage('adminKey'), 'or', errMessage('xPriv')); | ||
process.exit(1); | ||
} | ||
|
||
const client = exampleXPriv | ||
? new SpvWalletClient(server, { xPriv: exampleXPriv }) | ||
: new SpvWalletClient(server, { adminKey: exampleAdminKey }); | ||
|
||
const sharedConfig = await client.GetSharedConfig(); | ||
|
||
console.log(sharedConfig.paymail_domains[0]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters