@learncard/core 7.0.1 → 7.0.3

Sign up to get free protection for your applications and to get access to all the features.
package/dist/core.d.ts CHANGED
@@ -4741,6 +4741,7 @@ export declare type EthereumPluginMethods = {
4741
4741
  getBalance: (symbolOrAddress?: string) => Promise<string>;
4742
4742
  getBalanceForAddress: (walletAddress: string, symbolOrAddress?: string) => Promise<string>;
4743
4743
  transferTokens: (tokenSymbolOrAddress: string, amount: number, toAddress: string) => Promise<string>;
4744
+ getGasPrice: () => Promise<string>;
4744
4745
  getCurrentNetwork: () => providers.Networkish;
4745
4746
  changeNetwork: (network: providers.Networkish) => void;
4746
4747
  addInfuraProjectId: (infuraProjectIdToAdd: string) => void;
@@ -5228,6 +5229,12 @@ export declare type GetBalanceForAddress = (walletAddress: string, symbolOrAddre
5228
5229
  * @group LearnCard Methods
5229
5230
  */
5230
5231
  export declare type TransferTokens = (tokenSymbolOrAddress: string, amount: number, toAddress: string) => Promise<string>;
5232
+ /**
5233
+ * Get the gas price of the current network
5234
+ *
5235
+ * @group LearnCard Methods
5236
+ */
5237
+ export declare type GetGasPrice = () => Promise<string>;
5231
5238
  /**
5232
5239
  * Get your current Ethereum network
5233
5240
  *
@@ -5325,6 +5332,7 @@ export declare type AllLearnCardMethods = {
5325
5332
  getBalance: GetBalance;
5326
5333
  getBalanceForAddress: GetBalanceForAddress;
5327
5334
  transferTokens: TransferTokens;
5335
+ getGasPrice: GetGasPrice;
5328
5336
  getCurrentNetwork: GetCurrentNetwork;
5329
5337
  changeNetwork: ChangeNetwork;
5330
5338
  addInfuraProjectId: AddInfuraProjectId;
package/dist/core.esm.js CHANGED
@@ -56911,7 +56911,8 @@ var issueCredential2 = /* @__PURE__ */ __name((initWallet) => {
56911
56911
  throw new Error("Cannot issue credential: Could not get subject keypair");
56912
56912
  const options = __spreadValues({
56913
56913
  verificationMethod: yield initWallet.pluginMethods.keyToVerificationMethod("key", kp),
56914
- proofPurpose: "assertionMethod"
56914
+ proofPurpose: "assertionMethod",
56915
+ type: "Ed25519Signature2020"
56915
56916
  }, signingOptions);
56916
56917
  return initWallet.pluginMethods.issueCredential(credential, options, kp);
56917
56918
  });
@@ -56932,7 +56933,8 @@ var issuePresentation2 = /* @__PURE__ */ __name((initWallet) => {
56932
56933
  throw new Error("Cannot issue credential: Could not get subject keypair");
56933
56934
  const options = __spreadValues({
56934
56935
  verificationMethod: yield initWallet.pluginMethods.keyToVerificationMethod("key", kp),
56935
- proofPurpose: "assertionMethod"
56936
+ proofPurpose: "assertionMethod",
56937
+ type: "Ed25519Signature2020"
56936
56938
  }, signingOptions);
56937
56939
  return initWallet.pluginMethods.issuePresentation(presentation, options, kp);
56938
56940
  });
@@ -57112,6 +57114,9 @@ var getEthereumPlugin = /* @__PURE__ */ __name((initWallet, config2) => {
57112
57114
  const tokenContract = new ethers2.Contract(tokenAddress, ERC20ABI, ethersWallet);
57113
57115
  return (yield tokenContract.transfer(toAddress, yield parseUnits(amount.toString(), tokenContract.address, defaultTokenList, yield getChainIdFromProvider(provider)))).hash;
57114
57116
  }),
57117
+ getGasPrice: () => __async(void 0, null, function* () {
57118
+ return ethers2.utils.formatUnits(yield provider.getGasPrice());
57119
+ }),
57115
57120
  getCurrentNetwork: () => {
57116
57121
  return network;
57117
57122
  },
@@ -60378,6 +60383,7 @@ var walletFromKey = /* @__PURE__ */ __name((_0, ..._1) => __async(void 0, [_0, .
60378
60383
  getBalance: wallet.pluginMethods.getBalance,
60379
60384
  getBalanceForAddress: wallet.pluginMethods.getBalanceForAddress,
60380
60385
  transferTokens: wallet.pluginMethods.transferTokens,
60386
+ getGasPrice: wallet.pluginMethods.getGasPrice,
60381
60387
  getCurrentNetwork: wallet.pluginMethods.getCurrentNetwork,
60382
60388
  changeNetwork: wallet.pluginMethods.changeNetwork,
60383
60389
  addInfuraProjectId: wallet.pluginMethods.addInfuraProjectId,