@saib/cardano-bifrost
Advanced tools
Comparing version 0.0.3 to 0.0.4
{ | ||
"name": "@saib/cardano-bifrost", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "A Cardano CIP30 Wallet API Library", | ||
@@ -5,0 +5,0 @@ "main": "dist/Bifrost.js", |
@@ -32,2 +32,3 @@ export type BifrostWalletMetadata = { | ||
static _api?: BifrostWalletApi = undefined; | ||
static _currentWalletId: string | undefined = undefined; | ||
@@ -56,2 +57,3 @@ public static getWallets(): BifrostWalletMetadata[] { | ||
else Bifrost._api = result; | ||
Bifrost._currentWalletId = id; | ||
return true; | ||
@@ -71,2 +73,3 @@ } catch (ex) { | ||
await Bifrost.enableAsync(id); | ||
Bifrost._currentWalletId = id; | ||
} else Bifrost._throwNoAPIError(); | ||
@@ -126,8 +129,8 @@ } | ||
public static async signDataRawAsync(rewardAddrCborHex: string, message: string, walletId: BifrostWalletId) { | ||
public static async signDataRawAsync(addressCborHex: string, message: string) { | ||
if (Bifrost._api !== undefined) { | ||
if (walletId === "nami") | ||
return await Bifrost._cardano.signData(rewardAddrCborHex, message); | ||
if (Bifrost._currentWalletId === "nami") | ||
return await Bifrost._cardano.signData(addressCborHex, message); | ||
else | ||
return await Bifrost._api.signData(rewardAddrCborHex, message); | ||
return await Bifrost._api.signData(addressCborHex, message); | ||
} | ||
@@ -134,0 +137,0 @@ else |
29116
392