@dfns/lib-stellar 0.4.3-alpha.2 → 0.4.3
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/index.js +5 -5
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -21,7 +21,7 @@ class DfnsWallet {
|
|
|
21
21
|
constructor(metadata, options) {
|
|
22
22
|
this.metadata = metadata;
|
|
23
23
|
this.dfnsClient = options.dfnsClient;
|
|
24
|
-
this.network = metadata.network ===
|
|
24
|
+
this.network = metadata.network === "Stellar" ? stellar_sdk_1.Networks.PUBLIC : stellar_sdk_1.Networks.TESTNET;
|
|
25
25
|
}
|
|
26
26
|
static async init(options) {
|
|
27
27
|
const { walletId, dfnsClient } = options;
|
|
@@ -41,7 +41,7 @@ class DfnsWallet {
|
|
|
41
41
|
return this.metadata.address;
|
|
42
42
|
}
|
|
43
43
|
async sign(transaction) {
|
|
44
|
-
const isFeeBump =
|
|
44
|
+
const isFeeBump = "innerTransaction" in transaction;
|
|
45
45
|
const res = await this.dfnsClient.wallets.generateSignature({
|
|
46
46
|
walletId: this.metadata.id,
|
|
47
47
|
body: {
|
|
@@ -53,9 +53,9 @@ class DfnsWallet {
|
|
|
53
53
|
if (!res.signedData) {
|
|
54
54
|
throw new sdk_1.DfnsError(-1, 'signature missing', res);
|
|
55
55
|
}
|
|
56
|
-
return isFeeBump
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
return isFeeBump ?
|
|
57
|
+
new stellar_sdk_1.FeeBumpTransaction(hexToBase64(res.signedData), this.network) :
|
|
58
|
+
new stellar_sdk_1.Transaction(hexToBase64(res.signedData), this.network);
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
exports.DfnsWallet = DfnsWallet;
|
package/package.json
CHANGED