@algorandfoundation/algokit-utils 10.0.0-beta.1 → 10.0.0-beta.2

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/app-factory.d.ts CHANGED
@@ -628,6 +628,7 @@ declare class AppFactory {
628
628
  compiledApproval?: CompiledTeal | undefined;
629
629
  compiledClear?: CompiledTeal | undefined;
630
630
  operationPerformed: "create";
631
+ version: string;
631
632
  updatable?: boolean | undefined;
632
633
  deletable?: boolean | undefined;
633
634
  createdRound: bigint;
@@ -635,7 +636,6 @@ declare class AppFactory {
635
636
  createdMetadata: AppDeployMetadata;
636
637
  deleted: boolean;
637
638
  name: string;
638
- version: string;
639
639
  groupId: string | undefined;
640
640
  txIds: string[];
641
641
  returns?: ABIReturn[] | undefined;
@@ -674,6 +674,7 @@ declare class AppFactory {
674
674
  compiledApproval?: CompiledTeal | undefined;
675
675
  compiledClear?: CompiledTeal | undefined;
676
676
  operationPerformed: "replace";
677
+ version: string;
677
678
  updatable?: boolean | undefined;
678
679
  deletable?: boolean | undefined;
679
680
  createdRound: bigint;
@@ -681,7 +682,6 @@ declare class AppFactory {
681
682
  createdMetadata: AppDeployMetadata;
682
683
  deleted: boolean;
683
684
  name: string;
684
- version: string;
685
685
  groupId: string | undefined;
686
686
  txIds: string[];
687
687
  returns?: ABIReturn[] | undefined;
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "**"
7
7
  ],
8
8
  "name": "@algorandfoundation/algokit-utils",
9
- "version": "10.0.0-beta.1",
9
+ "version": "10.0.0-beta.2",
10
10
  "private": false,
11
11
  "description": "A set of core Algorand utilities written in TypeScript and released via npm that make it easier to build solutions on Algorand.",
12
12
  "author": "Algorand Foundation",
@@ -3,7 +3,7 @@ let _algorandfoundation_xhd_wallet_api = require("@algorandfoundation/xhd-wallet
3
3
  //#region packages/crypto/src/hd.ts
4
4
  const xhd = new _algorandfoundation_xhd_wallet_api.XHDWalletAPI();
5
5
  const peikertXHdWalletGenerator = async (seed) => {
6
- const seedArray = seed ?? new Uint8Array(32);
6
+ const seedArray = seed ?? new Uint8Array(64);
7
7
  if (seed === void 0) crypto.getRandomValues(seedArray);
8
8
  const rootKey = (0, _algorandfoundation_xhd_wallet_api.fromSeed)(Buffer.from(seedArray));
9
9
  const accountGenerator = async (account, index) => {
@@ -1 +1 @@
1
- {"version":3,"file":"hd.js","names":["XHDWalletAPI","KeyContext","BIP32DerivationType"],"sources":["../../../../packages/crypto/src/hd.ts"],"sourcesContent":["import { BIP32DerivationType, fromSeed, KeyContext, XHDWalletAPI, harden } from '@algorandfoundation/xhd-wallet-api'\nimport { RawEd25519Signer } from './ed25519'\nexport type BIP44Path = [number, number, number, number, number]\n\nexport type HdWalletGenerator = (seed?: Uint8Array) => Promise<{\n hdRootKey: Uint8Array\n accountGenerator: HdAccountGenerator\n}>\n\nexport type HdAccountGenerator = (\n account: number,\n index: number,\n) => Promise<{\n /** The ed25519 public key corresponding to the generated account and index. */\n ed25519Pubkey: Uint8Array\n /** The extended ed25519 private key (96 bytes for scalar + prefix + chain code) corresponding to the generated account and index. */\n extendedPrivateKey: Uint8Array\n /** The BIP44 path used to derive the key for the generated account and index. */\n bip44Path: BIP44Path\n /** A signer function that can sign bytes using the ed25519 secret key corresponding to the generated account and index. */\n rawEd25519Signer: RawEd25519Signer\n}>\n\nconst xhd = new XHDWalletAPI()\n\nexport const peikertXHdWalletGenerator: HdWalletGenerator = async (seed?: Uint8Array) => {\n const seedArray = seed ?? new Uint8Array(32)\n if (seed === undefined) {\n crypto.getRandomValues(seedArray)\n }\n\n const rootKey = fromSeed(Buffer.from(seedArray))\n\n const accountGenerator: HdAccountGenerator = async (account: number, index: number) => {\n const ed25519Pubkey = await xhd.keyGen(rootKey, KeyContext.Address, account, index, BIP32DerivationType.Peikert)\n\n const rawEd25519Signer: RawEd25519Signer = async (bytesToSign: Uint8Array): Promise<Uint8Array> => {\n return xhd.signAlgoTransaction(rootKey, KeyContext.Address, account, index, bytesToSign, BIP32DerivationType.Peikert)\n }\n\n const bip44Path: BIP44Path = [harden(44), harden(283), harden(account), 0, index]\n\n const xPrv = await xhd.deriveKey(rootKey, bip44Path, true, BIP32DerivationType.Peikert)\n\n return { ed25519Pubkey, rawEd25519Signer, bip44Path, extendedPrivateKey: xPrv }\n }\n\n return { hdRootKey: rootKey, accountGenerator }\n}\n\n/**\n * Represents a 96-byte `scalar (aka LHS or zL) || prefix (aka RHS or zR) || chain_code` secret that can be unwrapped\n * for short-lived use and then re-wrapped.\n *\n * It should be noted that the `chain_code` is NOT used for signing. It can, however, be used for key derivation.\n * If your secret is only used for signing, it is recommended to only store the first 64 bytes in the secret store\n * and then pad the secret to 96 bytes in the unwrap function\n */\nexport type WrappedHdExtendedPrivateKey = {\n /**\n * Unwraps and returns the 96-byte HD `scalar (aka LHS or zL) || prefix (aka RHS or zR) || chain_code`.\n */\n unwrapHdExtendedPrivateKey: () => Promise<Uint8Array>\n /**\n * Re-wraps the `scalar (aka LHS or zL) || prefix (aka RHS or zR) || chain_code` after use.\n */\n wrapHdExtendedPrivateKey: () => Promise<void>\n}\n"],"mappings":";;;AAuBA,MAAM,MAAM,IAAIA,mCAAAA,cAAc;AAE9B,MAAa,4BAA+C,OAAO,SAAsB;CACvF,MAAM,YAAY,QAAQ,IAAI,WAAW,GAAG;AAC5C,KAAI,SAAS,KAAA,EACX,QAAO,gBAAgB,UAAU;CAGnC,MAAM,WAAA,GAAA,mCAAA,UAAmB,OAAO,KAAK,UAAU,CAAC;CAEhD,MAAM,mBAAuC,OAAO,SAAiB,UAAkB;EACrF,MAAM,gBAAgB,MAAM,IAAI,OAAO,SAASC,mCAAAA,WAAW,SAAS,SAAS,OAAOC,mCAAAA,oBAAoB,QAAQ;EAEhH,MAAM,mBAAqC,OAAO,gBAAiD;AACjG,UAAO,IAAI,oBAAoB,SAASD,mCAAAA,WAAW,SAAS,SAAS,OAAO,aAAaC,mCAAAA,oBAAoB,QAAQ;;EAGvH,MAAM,YAAuB;kDAAQ,GAAG;kDAAS,IAAI;kDAAS,QAAQ;GAAE;GAAG;GAAM;AAIjF,SAAO;GAAE;GAAe;GAAkB;GAAW,oBAFxC,MAAM,IAAI,UAAU,SAAS,WAAW,MAAMA,mCAAAA,oBAAoB,QAAQ;GAER;;AAGjF,QAAO;EAAE,WAAW;EAAS;EAAkB"}
1
+ {"version":3,"file":"hd.js","names":["XHDWalletAPI","KeyContext","BIP32DerivationType"],"sources":["../../../../packages/crypto/src/hd.ts"],"sourcesContent":["import { BIP32DerivationType, fromSeed, KeyContext, XHDWalletAPI, harden } from '@algorandfoundation/xhd-wallet-api'\nimport { RawEd25519Signer } from './ed25519'\nexport type BIP44Path = [number, number, number, number, number]\n\nexport type HdWalletGenerator = (seed?: Uint8Array) => Promise<{\n hdRootKey: Uint8Array\n accountGenerator: HdAccountGenerator\n}>\n\nexport type HdAccountGenerator = (\n account: number,\n index: number,\n) => Promise<{\n /** The ed25519 public key corresponding to the generated account and index. */\n ed25519Pubkey: Uint8Array\n /** The extended ed25519 private key (96 bytes for scalar + prefix + chain code) corresponding to the generated account and index. */\n extendedPrivateKey: Uint8Array\n /** The BIP44 path used to derive the key for the generated account and index. */\n bip44Path: BIP44Path\n /** A signer function that can sign bytes using the ed25519 secret key corresponding to the generated account and index. */\n rawEd25519Signer: RawEd25519Signer\n}>\n\nconst xhd = new XHDWalletAPI()\n\nexport const peikertXHdWalletGenerator: HdWalletGenerator = async (seed?: Uint8Array) => {\n const seedArray = seed ?? new Uint8Array(64)\n if (seed === undefined) {\n crypto.getRandomValues(seedArray)\n }\n\n const rootKey = fromSeed(Buffer.from(seedArray))\n\n const accountGenerator: HdAccountGenerator = async (account: number, index: number) => {\n const ed25519Pubkey = await xhd.keyGen(rootKey, KeyContext.Address, account, index, BIP32DerivationType.Peikert)\n\n const rawEd25519Signer: RawEd25519Signer = async (bytesToSign: Uint8Array): Promise<Uint8Array> => {\n return xhd.signAlgoTransaction(rootKey, KeyContext.Address, account, index, bytesToSign, BIP32DerivationType.Peikert)\n }\n\n const bip44Path: BIP44Path = [harden(44), harden(283), harden(account), 0, index]\n\n const xPrv = await xhd.deriveKey(rootKey, bip44Path, true, BIP32DerivationType.Peikert)\n\n return { ed25519Pubkey, rawEd25519Signer, bip44Path, extendedPrivateKey: xPrv }\n }\n\n return { hdRootKey: rootKey, accountGenerator }\n}\n\n/**\n * Represents a 96-byte `scalar (aka LHS or zL) || prefix (aka RHS or zR) || chain_code` secret that can be unwrapped\n * for short-lived use and then re-wrapped.\n *\n * It should be noted that the `chain_code` is NOT used for signing. It can, however, be used for key derivation.\n * If your secret is only used for signing, it is recommended to only store the first 64 bytes in the secret store\n * and then pad the secret to 96 bytes in the unwrap function\n */\nexport type WrappedHdExtendedPrivateKey = {\n /**\n * Unwraps and returns the 96-byte HD `scalar (aka LHS or zL) || prefix (aka RHS or zR) || chain_code`.\n */\n unwrapHdExtendedPrivateKey: () => Promise<Uint8Array>\n /**\n * Re-wraps the `scalar (aka LHS or zL) || prefix (aka RHS or zR) || chain_code` after use.\n */\n wrapHdExtendedPrivateKey: () => Promise<void>\n}\n"],"mappings":";;;AAuBA,MAAM,MAAM,IAAIA,mCAAAA,cAAc;AAE9B,MAAa,4BAA+C,OAAO,SAAsB;CACvF,MAAM,YAAY,QAAQ,IAAI,WAAW,GAAG;AAC5C,KAAI,SAAS,KAAA,EACX,QAAO,gBAAgB,UAAU;CAGnC,MAAM,WAAA,GAAA,mCAAA,UAAmB,OAAO,KAAK,UAAU,CAAC;CAEhD,MAAM,mBAAuC,OAAO,SAAiB,UAAkB;EACrF,MAAM,gBAAgB,MAAM,IAAI,OAAO,SAASC,mCAAAA,WAAW,SAAS,SAAS,OAAOC,mCAAAA,oBAAoB,QAAQ;EAEhH,MAAM,mBAAqC,OAAO,gBAAiD;AACjG,UAAO,IAAI,oBAAoB,SAASD,mCAAAA,WAAW,SAAS,SAAS,OAAO,aAAaC,mCAAAA,oBAAoB,QAAQ;;EAGvH,MAAM,YAAuB;kDAAQ,GAAG;kDAAS,IAAI;kDAAS,QAAQ;GAAE;GAAG;GAAM;AAIjF,SAAO;GAAE;GAAe;GAAkB;GAAW,oBAFxC,MAAM,IAAI,UAAU,SAAS,WAAW,MAAMA,mCAAAA,oBAAoB,QAAQ;GAER;;AAGjF,QAAO;EAAE,WAAW;EAAS;EAAkB"}
@@ -2,7 +2,7 @@ import { BIP32DerivationType, KeyContext, XHDWalletAPI, fromSeed, harden } from
2
2
  //#region packages/crypto/src/hd.ts
3
3
  const xhd = new XHDWalletAPI();
4
4
  const peikertXHdWalletGenerator = async (seed) => {
5
- const seedArray = seed ?? new Uint8Array(32);
5
+ const seedArray = seed ?? new Uint8Array(64);
6
6
  if (seed === void 0) crypto.getRandomValues(seedArray);
7
7
  const rootKey = fromSeed(Buffer.from(seedArray));
8
8
  const accountGenerator = async (account, index) => {
@@ -1 +1 @@
1
- {"version":3,"file":"hd.mjs","names":[],"sources":["../../../../packages/crypto/src/hd.ts"],"sourcesContent":["import { BIP32DerivationType, fromSeed, KeyContext, XHDWalletAPI, harden } from '@algorandfoundation/xhd-wallet-api'\nimport { RawEd25519Signer } from './ed25519'\nexport type BIP44Path = [number, number, number, number, number]\n\nexport type HdWalletGenerator = (seed?: Uint8Array) => Promise<{\n hdRootKey: Uint8Array\n accountGenerator: HdAccountGenerator\n}>\n\nexport type HdAccountGenerator = (\n account: number,\n index: number,\n) => Promise<{\n /** The ed25519 public key corresponding to the generated account and index. */\n ed25519Pubkey: Uint8Array\n /** The extended ed25519 private key (96 bytes for scalar + prefix + chain code) corresponding to the generated account and index. */\n extendedPrivateKey: Uint8Array\n /** The BIP44 path used to derive the key for the generated account and index. */\n bip44Path: BIP44Path\n /** A signer function that can sign bytes using the ed25519 secret key corresponding to the generated account and index. */\n rawEd25519Signer: RawEd25519Signer\n}>\n\nconst xhd = new XHDWalletAPI()\n\nexport const peikertXHdWalletGenerator: HdWalletGenerator = async (seed?: Uint8Array) => {\n const seedArray = seed ?? new Uint8Array(32)\n if (seed === undefined) {\n crypto.getRandomValues(seedArray)\n }\n\n const rootKey = fromSeed(Buffer.from(seedArray))\n\n const accountGenerator: HdAccountGenerator = async (account: number, index: number) => {\n const ed25519Pubkey = await xhd.keyGen(rootKey, KeyContext.Address, account, index, BIP32DerivationType.Peikert)\n\n const rawEd25519Signer: RawEd25519Signer = async (bytesToSign: Uint8Array): Promise<Uint8Array> => {\n return xhd.signAlgoTransaction(rootKey, KeyContext.Address, account, index, bytesToSign, BIP32DerivationType.Peikert)\n }\n\n const bip44Path: BIP44Path = [harden(44), harden(283), harden(account), 0, index]\n\n const xPrv = await xhd.deriveKey(rootKey, bip44Path, true, BIP32DerivationType.Peikert)\n\n return { ed25519Pubkey, rawEd25519Signer, bip44Path, extendedPrivateKey: xPrv }\n }\n\n return { hdRootKey: rootKey, accountGenerator }\n}\n\n/**\n * Represents a 96-byte `scalar (aka LHS or zL) || prefix (aka RHS or zR) || chain_code` secret that can be unwrapped\n * for short-lived use and then re-wrapped.\n *\n * It should be noted that the `chain_code` is NOT used for signing. It can, however, be used for key derivation.\n * If your secret is only used for signing, it is recommended to only store the first 64 bytes in the secret store\n * and then pad the secret to 96 bytes in the unwrap function\n */\nexport type WrappedHdExtendedPrivateKey = {\n /**\n * Unwraps and returns the 96-byte HD `scalar (aka LHS or zL) || prefix (aka RHS or zR) || chain_code`.\n */\n unwrapHdExtendedPrivateKey: () => Promise<Uint8Array>\n /**\n * Re-wraps the `scalar (aka LHS or zL) || prefix (aka RHS or zR) || chain_code` after use.\n */\n wrapHdExtendedPrivateKey: () => Promise<void>\n}\n"],"mappings":";;AAuBA,MAAM,MAAM,IAAI,cAAc;AAE9B,MAAa,4BAA+C,OAAO,SAAsB;CACvF,MAAM,YAAY,QAAQ,IAAI,WAAW,GAAG;AAC5C,KAAI,SAAS,KAAA,EACX,QAAO,gBAAgB,UAAU;CAGnC,MAAM,UAAU,SAAS,OAAO,KAAK,UAAU,CAAC;CAEhD,MAAM,mBAAuC,OAAO,SAAiB,UAAkB;EACrF,MAAM,gBAAgB,MAAM,IAAI,OAAO,SAAS,WAAW,SAAS,SAAS,OAAO,oBAAoB,QAAQ;EAEhH,MAAM,mBAAqC,OAAO,gBAAiD;AACjG,UAAO,IAAI,oBAAoB,SAAS,WAAW,SAAS,SAAS,OAAO,aAAa,oBAAoB,QAAQ;;EAGvH,MAAM,YAAuB;GAAC,OAAO,GAAG;GAAE,OAAO,IAAI;GAAE,OAAO,QAAQ;GAAE;GAAG;GAAM;AAIjF,SAAO;GAAE;GAAe;GAAkB;GAAW,oBAFxC,MAAM,IAAI,UAAU,SAAS,WAAW,MAAM,oBAAoB,QAAQ;GAER;;AAGjF,QAAO;EAAE,WAAW;EAAS;EAAkB"}
1
+ {"version":3,"file":"hd.mjs","names":[],"sources":["../../../../packages/crypto/src/hd.ts"],"sourcesContent":["import { BIP32DerivationType, fromSeed, KeyContext, XHDWalletAPI, harden } from '@algorandfoundation/xhd-wallet-api'\nimport { RawEd25519Signer } from './ed25519'\nexport type BIP44Path = [number, number, number, number, number]\n\nexport type HdWalletGenerator = (seed?: Uint8Array) => Promise<{\n hdRootKey: Uint8Array\n accountGenerator: HdAccountGenerator\n}>\n\nexport type HdAccountGenerator = (\n account: number,\n index: number,\n) => Promise<{\n /** The ed25519 public key corresponding to the generated account and index. */\n ed25519Pubkey: Uint8Array\n /** The extended ed25519 private key (96 bytes for scalar + prefix + chain code) corresponding to the generated account and index. */\n extendedPrivateKey: Uint8Array\n /** The BIP44 path used to derive the key for the generated account and index. */\n bip44Path: BIP44Path\n /** A signer function that can sign bytes using the ed25519 secret key corresponding to the generated account and index. */\n rawEd25519Signer: RawEd25519Signer\n}>\n\nconst xhd = new XHDWalletAPI()\n\nexport const peikertXHdWalletGenerator: HdWalletGenerator = async (seed?: Uint8Array) => {\n const seedArray = seed ?? new Uint8Array(64)\n if (seed === undefined) {\n crypto.getRandomValues(seedArray)\n }\n\n const rootKey = fromSeed(Buffer.from(seedArray))\n\n const accountGenerator: HdAccountGenerator = async (account: number, index: number) => {\n const ed25519Pubkey = await xhd.keyGen(rootKey, KeyContext.Address, account, index, BIP32DerivationType.Peikert)\n\n const rawEd25519Signer: RawEd25519Signer = async (bytesToSign: Uint8Array): Promise<Uint8Array> => {\n return xhd.signAlgoTransaction(rootKey, KeyContext.Address, account, index, bytesToSign, BIP32DerivationType.Peikert)\n }\n\n const bip44Path: BIP44Path = [harden(44), harden(283), harden(account), 0, index]\n\n const xPrv = await xhd.deriveKey(rootKey, bip44Path, true, BIP32DerivationType.Peikert)\n\n return { ed25519Pubkey, rawEd25519Signer, bip44Path, extendedPrivateKey: xPrv }\n }\n\n return { hdRootKey: rootKey, accountGenerator }\n}\n\n/**\n * Represents a 96-byte `scalar (aka LHS or zL) || prefix (aka RHS or zR) || chain_code` secret that can be unwrapped\n * for short-lived use and then re-wrapped.\n *\n * It should be noted that the `chain_code` is NOT used for signing. It can, however, be used for key derivation.\n * If your secret is only used for signing, it is recommended to only store the first 64 bytes in the secret store\n * and then pad the secret to 96 bytes in the unwrap function\n */\nexport type WrappedHdExtendedPrivateKey = {\n /**\n * Unwraps and returns the 96-byte HD `scalar (aka LHS or zL) || prefix (aka RHS or zR) || chain_code`.\n */\n unwrapHdExtendedPrivateKey: () => Promise<Uint8Array>\n /**\n * Re-wraps the `scalar (aka LHS or zL) || prefix (aka RHS or zR) || chain_code` after use.\n */\n wrapHdExtendedPrivateKey: () => Promise<void>\n}\n"],"mappings":";;AAuBA,MAAM,MAAM,IAAI,cAAc;AAE9B,MAAa,4BAA+C,OAAO,SAAsB;CACvF,MAAM,YAAY,QAAQ,IAAI,WAAW,GAAG;AAC5C,KAAI,SAAS,KAAA,EACX,QAAO,gBAAgB,UAAU;CAGnC,MAAM,UAAU,SAAS,OAAO,KAAK,UAAU,CAAC;CAEhD,MAAM,mBAAuC,OAAO,SAAiB,UAAkB;EACrF,MAAM,gBAAgB,MAAM,IAAI,OAAO,SAAS,WAAW,SAAS,SAAS,OAAO,oBAAoB,QAAQ;EAEhH,MAAM,mBAAqC,OAAO,gBAAiD;AACjG,UAAO,IAAI,oBAAoB,SAAS,WAAW,SAAS,SAAS,OAAO,aAAa,oBAAoB,QAAQ;;EAGvH,MAAM,YAAuB;GAAC,OAAO,GAAG;GAAE,OAAO,IAAI;GAAE,OAAO,QAAQ;GAAE;GAAG;GAAM;AAIjF,SAAO;GAAE;GAAe;GAAkB;GAAW,oBAFxC,MAAM,IAAI,UAAU,SAAS,WAAW,MAAM,oBAAoB,QAAQ;GAER;;AAGjF,QAAO;EAAE,WAAW;EAAS;EAAkB"}