@joai/warps-adapter-fastset 1.0.1 → 1.1.0

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/dist/index.d.cts CHANGED
@@ -31,6 +31,7 @@ declare class WarpFastsetWallet implements AdapterWarpWallet {
31
31
  importFromPrivateKey(privateKey: string): Promise<WarpWalletDetails>;
32
32
  export(provider: WarpWalletProvider): Promise<WarpWalletDetails>;
33
33
  generate(provider: WarpWalletProvider): Promise<WarpWalletDetails>;
34
+ delete(provider: WarpWalletProvider, externalId: string): Promise<void>;
34
35
  getAddress(): string | null;
35
36
  getPublicKey(): string | null;
36
37
  private createProvider;
package/dist/index.d.ts CHANGED
@@ -31,6 +31,7 @@ declare class WarpFastsetWallet implements AdapterWarpWallet {
31
31
  importFromPrivateKey(privateKey: string): Promise<WarpWalletDetails>;
32
32
  export(provider: WarpWalletProvider): Promise<WarpWalletDetails>;
33
33
  generate(provider: WarpWalletProvider): Promise<WarpWalletDetails>;
34
+ delete(provider: WarpWalletProvider, externalId: string): Promise<void>;
34
35
  getAddress(): string | null;
35
36
  getPublicKey(): string | null;
36
37
  private createProvider;
package/dist/index.js CHANGED
@@ -210,11 +210,11 @@ function radix(num) {
210
210
  var genBase58 = /* @__NO_SIDE_EFFECTS__ */ (abc) => /* @__PURE__ */ chain(/* @__PURE__ */ radix(58), /* @__PURE__ */ alphabet(abc), /* @__PURE__ */ join(""));
211
211
  var base58 = /* @__PURE__ */ genBase58("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");
212
212
 
213
- // ../../node_modules/@mysten/utils/dist/esm/b58.js
213
+ // node_modules/@mysten/utils/dist/esm/b58.js
214
214
  var toBase58 = (buffer) => base58.encode(buffer);
215
215
  var fromBase58 = (str) => base58.decode(str);
216
216
 
217
- // ../../node_modules/@mysten/utils/dist/esm/b64.js
217
+ // node_modules/@mysten/utils/dist/esm/b64.js
218
218
  function fromBase64(base64String) {
219
219
  return Uint8Array.from(atob(base64String), (char) => char.charCodeAt(0));
220
220
  }
@@ -231,7 +231,7 @@ function toBase64(bytes) {
231
231
  return btoa(output);
232
232
  }
233
233
 
234
- // ../../node_modules/@mysten/utils/dist/esm/hex.js
234
+ // node_modules/@mysten/utils/dist/esm/hex.js
235
235
  function fromHex(hexStr) {
236
236
  const normalized = hexStr.startsWith("0x") ? hexStr.slice(2) : hexStr;
237
237
  const padded = normalized.length % 2 === 0 ? normalized : `0${normalized}`;
@@ -245,7 +245,7 @@ function toHex(bytes) {
245
245
  return bytes.reduce((str, byte) => str + byte.toString(16).padStart(2, "0"), "");
246
246
  }
247
247
 
248
- // ../../node_modules/@mysten/bcs/dist/esm/uleb.js
248
+ // node_modules/@mysten/bcs/dist/esm/uleb.js
249
249
  function ulebEncode(num) {
250
250
  let bigNum = BigInt(num);
251
251
  const arr = [];
@@ -288,7 +288,7 @@ function ulebDecode(arr) {
288
288
  };
289
289
  }
290
290
 
291
- // ../../node_modules/@mysten/bcs/dist/esm/reader.js
291
+ // node_modules/@mysten/bcs/dist/esm/reader.js
292
292
  var BcsReader = class {
293
293
  /**
294
294
  * @param {Uint8Array} data Data to use as a buffer.
@@ -401,7 +401,7 @@ var BcsReader = class {
401
401
  }
402
402
  };
403
403
 
404
- // ../../node_modules/@mysten/bcs/dist/esm/utils.js
404
+ // node_modules/@mysten/bcs/dist/esm/utils.js
405
405
  function encodeStr(data, encoding) {
406
406
  switch (encoding) {
407
407
  case "base58":
@@ -415,7 +415,7 @@ function encodeStr(data, encoding) {
415
415
  }
416
416
  }
417
417
 
418
- // ../../node_modules/@mysten/bcs/dist/esm/writer.js
418
+ // node_modules/@mysten/bcs/dist/esm/writer.js
419
419
  var BcsWriter = class {
420
420
  constructor({
421
421
  initialSize = 1024,
@@ -587,7 +587,7 @@ function toLittleEndian(bigint, size) {
587
587
  return result;
588
588
  }
589
589
 
590
- // ../../node_modules/@mysten/bcs/dist/esm/bcs-type.js
590
+ // node_modules/@mysten/bcs/dist/esm/bcs-type.js
591
591
  var __typeError = (msg) => {
592
592
  throw TypeError(msg);
593
593
  };
@@ -936,7 +936,7 @@ var BcsTuple = class extends BcsType {
936
936
  }
937
937
  };
938
938
 
939
- // ../../node_modules/@mysten/bcs/dist/esm/bcs.js
939
+ // node_modules/@mysten/bcs/dist/esm/bcs.js
940
940
  function fixedArray(size, type, options) {
941
941
  return new BcsType({
942
942
  read: (reader) => {
@@ -2482,6 +2482,9 @@ var _MnemonicWalletProvider = class _MnemonicWalletProvider {
2482
2482
  mnemonic
2483
2483
  };
2484
2484
  }
2485
+ async delete(externalId) {
2486
+ (0, import_warps6.removeWarpWalletFromConfig)(this.config, this.chain.name);
2487
+ }
2485
2488
  getPrivateKey() {
2486
2489
  if (this.privateKey) return this.privateKey;
2487
2490
  const mnemonic = (0, import_warps6.getWarpWalletMnemonicFromConfig)(this.config, this.chain.name);
@@ -2589,6 +2592,9 @@ var _PrivateKeyWalletProvider = class _PrivateKeyWalletProvider {
2589
2592
  mnemonic: null
2590
2593
  };
2591
2594
  }
2595
+ async delete(externalId) {
2596
+ (0, import_warps7.removeWarpWalletFromConfig)(this.config, this.chain.name);
2597
+ }
2592
2598
  getPrivateKey() {
2593
2599
  if (this.privateKey) return this.privateKey;
2594
2600
  const privateKeyHex = (0, import_warps7.getWarpWalletPrivateKeyFromConfig)(this.config, this.chain.name);
@@ -2637,6 +2643,9 @@ var ReadOnlyWalletProvider = class {
2637
2643
  const address = (0, import_warps8.getWarpWalletAddressFromConfig)(this.config, this.chain.name);
2638
2644
  throw new Error(`Wallet can not be used for signing: ${address}`);
2639
2645
  }
2646
+ async delete(externalId) {
2647
+ (0, import_warps8.removeWarpWalletFromConfig)(this.config, this.chain.name);
2648
+ }
2640
2649
  };
2641
2650
 
2642
2651
  // src/WarpFastsetWallet.ts
@@ -2693,6 +2702,10 @@ var WarpFastsetWallet = class {
2693
2702
  const walletProvider = this.createProviderForOperation(provider);
2694
2703
  return await walletProvider.generate();
2695
2704
  }
2705
+ async delete(provider, externalId) {
2706
+ const walletProvider = this.createProviderForOperation(provider);
2707
+ await walletProvider.delete(externalId);
2708
+ }
2696
2709
  getAddress() {
2697
2710
  return this.cachedAddress;
2698
2711
  }