@dfinity/nns 0.4.0 → 0.4.1

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.
Files changed (66) hide show
  1. package/dist/candid/genesis_token.certified.idl.js +37 -0
  2. package/dist/candid/genesis_token.did +30 -0
  3. package/dist/candid/genesis_token.idl.d.ts +10 -0
  4. package/dist/candid/genesis_token.idl.js +37 -0
  5. package/dist/candid/governance.certified.idl.js +14 -0
  6. package/dist/candid/governance.did +18 -4
  7. package/dist/candid/governance.idl.js +23 -5
  8. package/dist/candid/governanceTypes.d.ts +19 -13
  9. package/dist/candid/payloads.did +127 -21
  10. package/dist/candid/payloads.idl.d.ts +28 -1
  11. package/dist/candid/payloads.idl.js +97 -3
  12. package/dist/cjs/index.cjs.js +36 -33
  13. package/dist/cjs/index.cjs.js.map +3 -3
  14. package/dist/esm/account_identifier.js +1 -1
  15. package/dist/esm/{chunk-L4BUBLWY.js → chunk-E6UFXMWU.js} +20 -20
  16. package/dist/esm/{chunk-L4BUBLWY.js.map → chunk-E6UFXMWU.js.map} +2 -2
  17. package/dist/esm/{chunk-PKY54KPG.js → chunk-FL7E4DL3.js} +3 -3
  18. package/dist/esm/{chunk-PKY54KPG.js.map → chunk-FL7E4DL3.js.map} +1 -1
  19. package/dist/esm/chunk-HPCMNLTU.js +2 -0
  20. package/dist/esm/{chunk-7RUPLQYT.js.map → chunk-HPCMNLTU.js.map} +3 -3
  21. package/dist/esm/chunk-KUIJF2IJ.js +4 -0
  22. package/dist/esm/chunk-KUIJF2IJ.js.map +7 -0
  23. package/dist/esm/chunk-KXYKDST6.js +17 -0
  24. package/dist/esm/{chunk-BRAPLAM7.js.map → chunk-KXYKDST6.js.map} +3 -3
  25. package/dist/esm/chunk-MTPVFXPH.js +2 -0
  26. package/dist/esm/{chunk-EWMNJTAM.js.map → chunk-MTPVFXPH.js.map} +1 -1
  27. package/dist/esm/chunk-NOBP3Q32.js +7 -0
  28. package/dist/esm/chunk-NOBP3Q32.js.map +7 -0
  29. package/dist/esm/chunk-ONAVPXOT.js +2 -0
  30. package/dist/esm/chunk-ONAVPXOT.js.map +7 -0
  31. package/dist/esm/chunk-QNJXXPDD.js +2 -0
  32. package/dist/esm/chunk-QNJXXPDD.js.map +7 -0
  33. package/dist/esm/{chunk-CY2PTZ5N.js → chunk-XMQ7XZ3Q.js} +2 -2
  34. package/dist/esm/{chunk-CY2PTZ5N.js.map → chunk-XMQ7XZ3Q.js.map} +1 -1
  35. package/dist/esm/genesis_token.js +2 -0
  36. package/dist/esm/genesis_token.js.map +7 -0
  37. package/dist/esm/governance.js +1 -1
  38. package/dist/esm/icp.js +1 -1
  39. package/dist/esm/index.js +1 -1
  40. package/dist/esm/index.js.map +3 -3
  41. package/dist/esm/ledger.js +1 -1
  42. package/dist/proto/governance.proto +287 -0
  43. package/dist/proto/governance_pb.d.ts +1055 -0
  44. package/dist/proto/governance_pb.js +7806 -0
  45. package/dist/types/canisters/governance/request.converters.d.ts +15 -0
  46. package/dist/types/canisters/governance/request.proto.converters.d.ts +15 -0
  47. package/dist/types/canisters/governance/response.converters.d.ts +2 -0
  48. package/dist/types/canisters/governance/response.proto.converters.d.ts +1 -0
  49. package/dist/types/canisters/governance/services.d.ts +7 -1
  50. package/dist/types/constants/canister_ids.d.ts +1 -0
  51. package/dist/types/errors/governance.errors.d.ts +7 -1
  52. package/dist/types/genesis_token.d.ts +17 -0
  53. package/dist/types/governance.d.ts +49 -1
  54. package/dist/types/index.d.ts +2 -0
  55. package/dist/types/types/governance.d.ts +1 -0
  56. package/dist/types/types/governance_converters.d.ts +10 -5
  57. package/dist/types/utils/account_identifier.utils.d.ts +5 -0
  58. package/dist/types/utils/accounts.utils.d.ts +6 -0
  59. package/dist/types/utils/converter.utils.d.ts +0 -5
  60. package/dist/types/utils/number.utils.d.ts +1 -0
  61. package/package.json +17 -17
  62. package/dist/esm/chunk-7RUPLQYT.js +0 -4
  63. package/dist/esm/chunk-BRAPLAM7.js +0 -18
  64. package/dist/esm/chunk-DEPEAMHA.js +0 -3
  65. package/dist/esm/chunk-DEPEAMHA.js.map +0 -7
  66. package/dist/esm/chunk-EWMNJTAM.js +0 -2
@@ -24,6 +24,21 @@ export declare const toRegisterVoteRequest: ({ neuronId, vote, proposalId, }: {
24
24
  }) => RawManageNeuron;
25
25
  export declare const toMakeProposalRawRequest: (request: MakeProposalRequest) => RawManageNeuron;
26
26
  export declare const toManageNeuronsFollowRequest: ({ neuronId, topic, followees, }: FollowRequest) => RawManageNeuron;
27
+ export declare const toDisburseNeuronRequest: ({ neuronId, toAccountId, amount, }: {
28
+ neuronId: NeuronId;
29
+ toAccountId?: string | undefined;
30
+ amount?: bigint | undefined;
31
+ }) => RawManageNeuron;
32
+ export declare const toMergeMaturityRequest: ({ neuronId, percentageToMerge, }: {
33
+ neuronId: NeuronId;
34
+ percentageToMerge: number;
35
+ }) => RawManageNeuron;
36
+ export declare const toSpawnNeuronRequest: ({ neuronId, percentageToSpawn, newController, nonce, }: {
37
+ neuronId: NeuronId;
38
+ percentageToSpawn?: number | undefined;
39
+ newController?: Principal | undefined;
40
+ nonce?: bigint | undefined;
41
+ }) => RawManageNeuron;
27
42
  export declare const toAddHotkeyRequest: ({ neuronId, principal, }: {
28
43
  neuronId: NeuronId;
29
44
  principal: Principal;
@@ -0,0 +1,15 @@
1
+ import { ManageNeuron as PbManageNeuron } from "../../../proto/governance_pb";
2
+ import { NeuronId } from "../../types/common";
3
+ import { AddHotKeyRequest, DisburseRequest, MergeMaturityRequest, MergeRequest, RemoveHotKeyRequest, SpawnRequest } from "../../types/governance_converters";
4
+ export declare const fromAddHotKeyRequest: (request: AddHotKeyRequest) => PbManageNeuron;
5
+ export declare const fromRemoveHotKeyRequest: (request: RemoveHotKeyRequest) => PbManageNeuron;
6
+ export declare const fromIncreaseDissolveDelayRequest: ({ neuronId, additionalDissolveDelaySeconds, }: {
7
+ neuronId: NeuronId;
8
+ additionalDissolveDelaySeconds: number;
9
+ }) => PbManageNeuron;
10
+ export declare const fromStartDissolvingRequest: (neuronId: NeuronId) => PbManageNeuron;
11
+ export declare const fromStopDissolvingRequest: (neuronId: NeuronId) => PbManageNeuron;
12
+ export declare const fromDisburseRequest: (request: DisburseRequest) => PbManageNeuron;
13
+ export declare const fromMergeMaturityRequest: (request: MergeMaturityRequest) => PbManageNeuron;
14
+ export declare const fromSpawnRequest: (request: SpawnRequest) => PbManageNeuron;
15
+ export declare const fromMergeRequest: (request: MergeRequest) => PbManageNeuron;
@@ -1,6 +1,8 @@
1
1
  import { KnownNeuron as RawKnownNeuron, ListNeuronsResponse as RawListNeuronsResponse, ListProposalInfoResponse as RawListProposalInfoResponse, ProposalInfo as RawProposalInfo } from "../../../candid/governanceTypes.d";
2
+ import { ListNeuronsResponse, Neuron as PbNeuron } from "../../../proto/governance_pb";
2
3
  import { KnownNeuron, ListProposalsResponse, NeuronInfo, ProposalInfo } from "../../types/governance_converters";
3
4
  export declare const toProposalInfo: (proposalInfo: RawProposalInfo) => ProposalInfo;
4
5
  export declare const toArrayOfNeuronInfo: ({ neuron_infos, full_neurons, }: RawListNeuronsResponse) => Array<NeuronInfo>;
5
6
  export declare const toListProposalsResponse: ({ proposal_info, }: RawListProposalInfoResponse) => ListProposalsResponse;
6
7
  export declare const toKnownNeuron: ({ id, known_neuron_data, }: RawKnownNeuron) => KnownNeuron;
8
+ export declare const convertPbNeuronToNeuronInfo: (pbNeurons: PbNeuron[]) => (pbNeuronMapEntry: ListNeuronsResponse.NeuronMapEntry) => NeuronInfo;
@@ -0,0 +1 @@
1
+ export declare const checkPbManageNeuronResponse: (rawResponse: Uint8Array) => void;
@@ -1,5 +1,11 @@
1
1
  import { GovernanceService } from "../../../candid/governance.idl";
2
- import { ManageNeuron } from "../../../candid/governanceTypes";
2
+ import { Command_1, ManageNeuron, ManageNeuronResponse } from "../../../candid/governanceTypes";
3
+ /**
4
+ * Checks a Manage Neuron Response for error and returns successful response data.
5
+ *
6
+ * @throws {@link GovernanceError}
7
+ */
8
+ export declare const getSuccessfulCommandFromResponse: (response: ManageNeuronResponse) => Command_1;
3
9
  /**
4
10
  * @throws {@link GovernanceError}
5
11
  */
@@ -2,3 +2,4 @@ import { Principal } from "@dfinity/principal";
2
2
  export declare const GOVERNANCE_CANISTER_ID: Principal;
3
3
  export declare const MAINNET_GOVERNANCE_CANISTER_ID: Principal;
4
4
  export declare const MAINNET_LEDGER_CANISTER_ID: Principal;
5
+ export declare const MAINNET_GENESIS_TOKEN_CANISTER_ID: Principal;
@@ -1,4 +1,4 @@
1
- import { GovernanceErrorDetail } from "../../candid/governanceTypes";
1
+ import { GovernanceError as GovernanceErrorDetail } from "../../candid/governanceTypes";
2
2
  import { ICP } from "../icp";
3
3
  export declare abstract class StakeNeuronError extends Error {
4
4
  }
@@ -14,9 +14,15 @@ export declare class GovernanceError extends Error {
14
14
  readonly detail: GovernanceErrorDetail;
15
15
  constructor(detail: GovernanceErrorDetail);
16
16
  }
17
+ export declare class InvalidPercentageError extends Error {
18
+ }
19
+ export declare class InvalidAccountIDError extends Error {
20
+ }
17
21
  /**
18
22
  * An error used to ensure at compile-time that it's never reached.
19
23
  */
20
24
  export declare class UnsupportedValueError extends Error {
21
25
  constructor(value: never);
22
26
  }
27
+ export declare class FeatureNotSupportedError extends Error {
28
+ }
@@ -0,0 +1,17 @@
1
+ import { Agent } from "@dfinity/agent";
2
+ import { Principal } from "@dfinity/principal";
3
+ import { GenesisTokenService } from "../candid/genesis_token.idl";
4
+ import { NeuronId } from "./types/common";
5
+ export interface GenesisTokenCanisterOptions {
6
+ agent?: Agent;
7
+ canisterId?: Principal;
8
+ serviceOverride?: GenesisTokenService;
9
+ }
10
+ export declare class GenesisTokenCanister {
11
+ private readonly service;
12
+ private constructor();
13
+ static create(options?: GenesisTokenCanisterOptions): GenesisTokenCanister;
14
+ claimNeurons: ({ hexPubKey, }: {
15
+ hexPubKey: string;
16
+ }) => Promise<NeuronId[]>;
17
+ }
@@ -1,13 +1,15 @@
1
1
  import { Principal } from "@dfinity/principal";
2
2
  import { ICP } from "./icp";
3
3
  import { LedgerCanister } from "./ledger";
4
- import { NeuronId } from "./types/common";
4
+ import { E8s, NeuronId } from "./types/common";
5
5
  import { GovernanceCanisterOptions } from "./types/governance";
6
6
  import { ClaimOrRefreshNeuronRequest, FollowRequest, KnownNeuron, ListProposalsRequest, ListProposalsResponse, MakeProposalRequest, NeuronInfo, ProposalId, ProposalInfo, Vote } from "./types/governance_converters";
7
7
  export declare class GovernanceCanister {
8
8
  private readonly canisterId;
9
9
  private readonly service;
10
10
  private readonly certifiedService;
11
+ private readonly agent;
12
+ private readonly hardwareWallet;
11
13
  private constructor();
12
14
  static create(options?: GovernanceCanisterOptions): GovernanceCanister;
13
15
  /**
@@ -133,6 +135,41 @@ export declare class GovernanceCanister {
133
135
  * @throws {@link GovernanceError}
134
136
  */
135
137
  setFollowees: (followRequest: FollowRequest) => Promise<void>;
138
+ /**
139
+ * Disburse neuron on Account
140
+ *
141
+ * @throws {@link GovernanceError}
142
+ * @throws {@link InvalidAccountIDError}
143
+ */
144
+ disburse: ({ neuronId, toAccountId, amount, }: {
145
+ neuronId: NeuronId;
146
+ toAccountId?: string | undefined;
147
+ amount?: bigint | undefined;
148
+ }) => Promise<void>;
149
+ /**
150
+ * Merge Maturity of a neuron
151
+ *
152
+ * @throws {@link GovernanceError}
153
+ * @throws {@link InvalidPercentageError}
154
+ *
155
+ */
156
+ mergeMaturity: ({ neuronId, percentageToMerge, }: {
157
+ neuronId: NeuronId;
158
+ percentageToMerge: number;
159
+ }) => Promise<void>;
160
+ /**
161
+ * Merge Maturity of a neuron
162
+ *
163
+ * @throws {@link GovernanceError}
164
+ * @throws {@link InvalidPercentageError}
165
+ *
166
+ */
167
+ spawnNeuron: ({ neuronId, percentageToSpawn, newController, nonce, }: {
168
+ neuronId: NeuronId;
169
+ percentageToSpawn?: number | undefined;
170
+ newController?: Principal | undefined;
171
+ nonce?: bigint | undefined;
172
+ }) => Promise<bigint>;
136
173
  /**
137
174
  * Add hotkey to neuron
138
175
  *
@@ -174,4 +211,15 @@ export declare class GovernanceCanister {
174
211
  certified: boolean;
175
212
  neuronId: NeuronId;
176
213
  }) => Promise<NeuronInfo | undefined>;
214
+ private listNeuronsHardwareWallet;
215
+ private manageNeuronUpdateCall;
216
+ private addHotkeyHardwareWallet;
217
+ private removeHotkeyHardwareWallet;
218
+ private increaseDissolveDelayHardwareWallet;
219
+ private startDissolvingHardwareWallet;
220
+ private stopDissolvingHardwareWallet;
221
+ private disburseHardwareWallet;
222
+ private mergeMaturityHardwareWallet;
223
+ private spawnHardwareWallet;
224
+ private mergeNeuronsHardwareWallet;
177
225
  }
@@ -9,4 +9,6 @@ export * from "./types/governance";
9
9
  export * from "./types/governance_converters";
10
10
  export * from "./types/icp";
11
11
  export * from "./types/ledger";
12
+ export * from "./utils/accounts.utils";
13
+ export * from "./utils/account_identifier.utils";
12
14
  export * from "./utils/neurons.utils";
@@ -6,4 +6,5 @@ export interface GovernanceCanisterOptions {
6
6
  canisterId?: Principal;
7
7
  serviceOverride?: GovernanceService;
8
8
  certifiedServiceOverride?: GovernanceService;
9
+ hardwareWallet?: boolean;
9
10
  }
@@ -164,6 +164,10 @@ export interface ManageNeuron {
164
164
  export interface Merge {
165
165
  sourceNeuronId: Option<NeuronId>;
166
166
  }
167
+ export interface MergeRequest {
168
+ sourceNeuronId: NeuronId;
169
+ targetNeuronId: NeuronId;
170
+ }
167
171
  export interface MergeMaturity {
168
172
  percentageToMerge: number;
169
173
  }
@@ -238,11 +242,6 @@ export interface NeuronInfo {
238
242
  ageSeconds: bigint;
239
243
  fullNeuron: Option<Neuron>;
240
244
  }
241
- export interface NeuronInfoForHw {
242
- id: string;
243
- amount: string;
244
- hotKeys: Array<PrincipalString>;
245
- }
246
245
  export interface NodeProvider {
247
246
  id: Option<PrincipalString>;
248
247
  rewardAccount: Option<AccountIdentifier>;
@@ -318,6 +317,7 @@ export declare type RewardMode = {
318
317
  RewardToAccount: RewardToAccount;
319
318
  };
320
319
  export declare type RewardNodeProviders = {
320
+ useRegistryDerivedRewards: boolean | undefined;
321
321
  rewards: Array<RewardNodeProvider>;
322
322
  };
323
323
  export interface RewardToAccount {
@@ -341,6 +341,7 @@ export interface SetDefaultFollowees {
341
341
  }
342
342
  export interface Spawn {
343
343
  newController: Option<PrincipalString>;
344
+ percentageToSpawn: number | undefined;
344
345
  }
345
346
  export interface Split {
346
347
  amount: E8s;
@@ -395,6 +396,7 @@ export interface RegisterVoteRequest {
395
396
  export interface SpawnRequest {
396
397
  neuronId: NeuronId;
397
398
  newController: Option<PrincipalString>;
399
+ percentageToSpawn?: number;
398
400
  }
399
401
  export interface SplitRequest {
400
402
  neuronId: NeuronId;
@@ -461,3 +463,6 @@ export interface MakeExecuteNnsFunctionProposalRequest {
461
463
  nnsFunction: number;
462
464
  payload: ArrayBuffer;
463
465
  }
466
+ export interface ListNodeProvidersResponse {
467
+ nodeProviders: NodeProvider[];
468
+ }
@@ -0,0 +1,5 @@
1
+ import { Principal } from "@dfinity/principal";
2
+ import { AccountIdentifier } from "../types/common";
3
+ export declare const accountIdentifierToBytes: (accountIdentifier: AccountIdentifier) => Uint8Array;
4
+ export declare const accountIdentifierFromBytes: (accountIdentifier: Uint8Array) => AccountIdentifier;
5
+ export declare const principalToAccountIdentifier: (principal: Principal, subAccount?: Uint8Array | undefined) => string;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Checks account id check sum
3
+ *
4
+ * @throws InvalidAccountIDError
5
+ */
6
+ export declare const checkAccountId: (accountId: string) => void;
@@ -1,13 +1,8 @@
1
- import { Principal } from "@dfinity/principal";
2
- import { AccountIdentifier } from "../types/common";
3
1
  export declare const uint8ArrayToBigInt: (array: Uint8Array) => bigint;
4
2
  export declare const arrayBufferToArrayOfNumber: (buffer: ArrayBuffer) => Array<number>;
5
3
  export declare const arrayOfNumberToUint8Array: (numbers: Array<number>) => Uint8Array;
6
4
  export declare const arrayOfNumberToArrayBuffer: (numbers: Array<number>) => ArrayBuffer;
7
5
  export declare const numberToArrayBuffer: (value: number, byteLength: number) => ArrayBuffer;
8
6
  export declare const asciiStringToByteArray: (text: string) => Array<number>;
9
- export declare const accountIdentifierToBytes: (accountIdentifier: AccountIdentifier) => Uint8Array;
10
- export declare const accountIdentifierFromBytes: (accountIdentifier: Uint8Array) => AccountIdentifier;
11
- export declare const principalToAccountIdentifier: (principal: Principal, subAccount?: Uint8Array | undefined) => string;
12
7
  export declare const toHexString: (bytes: Uint8Array) => string;
13
8
  export declare const calculateCrc32: (bytes: Uint8Array) => Uint8Array;
@@ -0,0 +1 @@
1
+ export declare const assertPercentageNumber: (percentage: number) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dfinity/nns",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "A library for interfacing with the Internet Computer's Network Nervous System.",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/cjs/index.cjs.js",
@@ -24,36 +24,36 @@
24
24
  "protoc": "bash ./scripts/update_proto.sh"
25
25
  },
26
26
  "dependencies": {
27
- "@dfinity/agent": "^0.11.0",
28
- "@dfinity/candid": "^0.11.0",
29
- "@dfinity/principal": "^0.11.0",
27
+ "@dfinity/agent": "^0.11.1",
28
+ "@dfinity/candid": "^0.11.1",
29
+ "@dfinity/principal": "^0.11.1",
30
30
  "crc": "^4.1.1",
31
31
  "crc-32": "^1.2.2",
32
- "google-protobuf": "^3.20.0",
32
+ "google-protobuf": "^3.20.1",
33
33
  "js-sha256": "^0.9.0",
34
34
  "randombytes": "^2.1.0"
35
35
  },
36
36
  "devDependencies": {
37
- "@types/google-protobuf": "^3.15.5",
38
- "@types/jest": "^27.4.1",
37
+ "@types/google-protobuf": "^3.15.6",
38
+ "@types/jest": "^27.5.0",
39
39
  "@types/randombytes": "^2.0.0",
40
40
  "@types/text-encoding": "^0.0.36",
41
- "@typescript-eslint/eslint-plugin": "^5.18.0",
42
- "esbuild": "^0.14.34",
43
- "eslint": "^7.29.0",
44
- "eslint-config-standard": "^16.0.3",
45
- "eslint-plugin-import": "^2.23.4",
41
+ "@typescript-eslint/eslint-plugin": "^5.23.0",
42
+ "esbuild": "^0.14.38",
43
+ "eslint": "^8.15.0",
44
+ "eslint-config-standard": "^17.0.0",
45
+ "eslint-plugin-import": "^2.26.0",
46
46
  "eslint-plugin-node": "^11.1.0",
47
- "eslint-plugin-promise": "^5.1.0",
48
- "jest": "^27.5.1",
49
- "jest-mock-extended": "^2.0.5",
47
+ "eslint-plugin-promise": "^6.0.0",
48
+ "jest": "^28.1.0",
49
+ "jest-mock-extended": "^2.0.6",
50
50
  "prettier": "^2.6.2",
51
51
  "prettier-plugin-organize-imports": "^2.3.4",
52
52
  "text-encoding": "^0.7.0",
53
- "ts-jest": "^27.1.4",
53
+ "ts-jest": "^28.0.2",
54
54
  "ts-protoc-gen": "^0.15.0",
55
55
  "typedoc": "^0.22.15",
56
- "typescript": "^4.5.2",
56
+ "typescript": "^4.5.5",
57
57
  "whatwg-fetch": "^3.6.2"
58
58
  },
59
59
  "repository": {
@@ -1,4 +0,0 @@
1
- import{c as d,g as T,h as x}from"./chunk-L4BUBLWY.js";import{i as A}from"./chunk-BRAPLAM7.js";import{a as B,d as l}from"./chunk-EWMNJTAM.js";import{c as C,e as P}from"./chunk-PKY54KPG.js";var o=C(P());var m=C(P());var q=r=>{let e=A(r,32),t=new m.Subaccount;return t.setSubAccount(new Uint8Array(e)),t},E=r=>{let e=new m.ICPTs;return e.setE8s(r.toString(10)),e};var s=class extends Error{},f=class extends s{},g=class extends s{constructor(t){super();this.balance=t}},y=class extends s{constructor(t){super();this.allowed_window_secs=t}},b=class extends s{},h=class extends s{constructor(t){super();this.duplicateOf=t}},S=r=>{let{message:e}=r;if(e.includes("Reject code: 5")){if(e.match(/Sending from (.*) is not allowed/))return new f;{let t=e.match(/transaction.*duplicate.* in block (\d+)/);if(t&&t.length>1)return new h(BigInt(t[1]))}{let t=e.match(/debit account.*, current balance: (\d*(\.\d*)?)/);if(t&&t.length>1){let a=l.fromString(t[1]);if(a instanceof l)return new g(a)}}if(e.includes("is in future"))return new b;{let t=e.match(/older than (\d+)/);if(t&&t.length>1)return new y(Number.parseInt(t[1]))}}throw r};var _=async({agent:r,canisterId:e,methodName:t,arg:a})=>{let n=await r.call(e,{methodName:t,arg:a,effectiveCanisterId:e});if(!n.response.ok)throw new Error(["Call failed:",` Method: ${t}`,` Canister ID: ${e}`,` Request ID: ${n.requestId}`,` HTTP status code: ${n.response.status}`,` HTTP status text: ${n.response.statusText}`].join(`
2
- `));let i=await d.pollForResponse(r,e,n.requestId,d.defaultStrategy());return new Uint8Array(i)},H=async({agent:r,canisterId:e,methodName:t,arg:a})=>{let n=await r.query(e,{methodName:t,arg:a});if(n.status=="rejected")throw new Error(["Call failed:",` Method: ${t}`,` Canister ID: ${e}`,` HTTP status code: ${n.reject_code}`,` HTTP status text: ${n.reject_message}`].join(`
3
- `));return new Uint8Array(n.reply.arg)};var p=class{constructor(e,t,a,n){this.agent=e;this.canisterId=t;this.updateFetcher=a;this.queryFetcher=n}static create(e={}){return new p(e.agent??x(),e.canisterId??T,e.updateCallOverride??_,e.queryCallOverride??H)}accountBalance=async({accountIdentifier:e,certified:t=!0})=>{let a=t?this.updateFetcher:this.queryFetcher,n=new o.AccountBalanceRequest;n.setAccount(e.toProto());let i=await a({agent:this.agent,canisterId:this.canisterId,methodName:"account_balance_pb",arg:n.serializeBinary()});return l.fromE8s(BigInt(o.ICPTs.deserializeBinary(new Uint8Array(i)).getE8s()))};transfer=async({to:e,amount:t,memo:a,fee:n,fromSubAccountId:i})=>{let c=new o.SendRequest;c.setTo(e.toProto());let w=new o.Payment;w.setReceiverGets(t.toProto()),c.setPayment(w),c.setMaxFee(E(n??B));let I=new o.Memo;I.setMemo((a??BigInt(0)).toString()),c.setMemo(I),i!==void 0&&c.setFromSubaccount(q(i));try{let u=await this.updateFetcher({agent:this.agent,canisterId:this.canisterId,methodName:"send_pb",arg:c.serializeBinary()});return BigInt(o.BlockHeight.deserializeBinary(u).getHeight())}catch(u){throw u instanceof Error?S(u):u}}};export{s as a,f as b,g as c,y as d,b as e,h as f,S as g,p as h};
4
- //# sourceMappingURL=chunk-7RUPLQYT.js.map
@@ -1,18 +0,0 @@
1
- import{a as M,c as $}from"./chunk-PKY54KPG.js";var d0=M((exports,module)=>{(function(){"use strict";var ERROR="input is invalid type",WINDOW=typeof window=="object",root=WINDOW?window:{};root.JS_SHA256_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&typeof self=="object",NODE_JS=!root.JS_SHA256_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;NODE_JS?root=window:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_SHA256_NO_COMMON_JS&&typeof module=="object"&&module.exports,AMD=typeof define=="function"&&define.amd,ARRAY_BUFFER=!root.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",HEX_CHARS="0123456789abcdef".split(""),EXTRA=[-2147483648,8388608,32768,128],SHIFT=[24,16,8,0],K=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],OUTPUT_TYPES=["hex","array","digest","arrayBuffer"],blocks=[];(root.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(r){return Object.prototype.toString.call(r)==="[object Array]"}),ARRAY_BUFFER&&(root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(r){return typeof r=="object"&&r.buffer&&r.buffer.constructor===ArrayBuffer});var createOutputMethod=function(r,x){return function(e){return new Sha256(x,!0).update(e)[r]()}},createMethod=function(r){var x=createOutputMethod("hex",r);NODE_JS&&(x=nodeWrap(x,r)),x.create=function(){return new Sha256(r)},x.update=function(i){return x.create().update(i)};for(var e=0;e<OUTPUT_TYPES.length;++e){var t=OUTPUT_TYPES[e];x[t]=createOutputMethod(t,r)}return x},nodeWrap=function(method,is224){var crypto=eval("require('crypto')"),Buffer=eval("require('buffer').Buffer"),algorithm=is224?"sha224":"sha256",nodeMethod=function(r){if(typeof r=="string")return crypto.createHash(algorithm).update(r,"utf8").digest("hex");if(r==null)throw new Error(ERROR);return r.constructor===ArrayBuffer&&(r=new Uint8Array(r)),Array.isArray(r)||ArrayBuffer.isView(r)||r.constructor===Buffer?crypto.createHash(algorithm).update(new Buffer(r)).digest("hex"):method(r)};return nodeMethod},createHmacOutputMethod=function(r,x){return function(e,t){return new HmacSha256(e,x,!0).update(t)[r]()}},createHmacMethod=function(r){var x=createHmacOutputMethod("hex",r);x.create=function(i){return new HmacSha256(i,r)},x.update=function(i,c){return x.create(i).update(c)};for(var e=0;e<OUTPUT_TYPES.length;++e){var t=OUTPUT_TYPES[e];x[t]=createHmacOutputMethod(t,r)}return x};function Sha256(r,x){x?(blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],r?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=r}Sha256.prototype.update=function(r){if(!this.finalized){var x,e=typeof r;if(e!=="string"){if(e==="object"){if(r===null)throw new Error(ERROR);if(ARRAY_BUFFER&&r.constructor===ArrayBuffer)r=new Uint8Array(r);else if(!Array.isArray(r)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(r)))throw new Error(ERROR)}else throw new Error(ERROR);x=!0}for(var t,i=0,c,f=r.length,a=this.blocks;i<f;){if(this.hashed&&(this.hashed=!1,a[0]=this.block,a[16]=a[1]=a[2]=a[3]=a[4]=a[5]=a[6]=a[7]=a[8]=a[9]=a[10]=a[11]=a[12]=a[13]=a[14]=a[15]=0),x)for(c=this.start;i<f&&c<64;++i)a[c>>2]|=r[i]<<SHIFT[c++&3];else for(c=this.start;i<f&&c<64;++i)t=r.charCodeAt(i),t<128?a[c>>2]|=t<<SHIFT[c++&3]:t<2048?(a[c>>2]|=(192|t>>6)<<SHIFT[c++&3],a[c>>2]|=(128|t&63)<<SHIFT[c++&3]):t<55296||t>=57344?(a[c>>2]|=(224|t>>12)<<SHIFT[c++&3],a[c>>2]|=(128|t>>6&63)<<SHIFT[c++&3],a[c>>2]|=(128|t&63)<<SHIFT[c++&3]):(t=65536+((t&1023)<<10|r.charCodeAt(++i)&1023),a[c>>2]|=(240|t>>18)<<SHIFT[c++&3],a[c>>2]|=(128|t>>12&63)<<SHIFT[c++&3],a[c>>2]|=(128|t>>6&63)<<SHIFT[c++&3],a[c>>2]|=(128|t&63)<<SHIFT[c++&3]);this.lastByteIndex=c,this.bytes+=c-this.start,c>=64?(this.block=a[16],this.start=c-64,this.hash(),this.hashed=!0):this.start=c}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Sha256.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var r=this.blocks,x=this.lastByteIndex;r[16]=this.block,r[x>>2]|=EXTRA[x&3],this.block=r[16],x>=56&&(this.hashed||this.hash(),r[0]=this.block,r[16]=r[1]=r[2]=r[3]=r[4]=r[5]=r[6]=r[7]=r[8]=r[9]=r[10]=r[11]=r[12]=r[13]=r[14]=r[15]=0),r[14]=this.hBytes<<3|this.bytes>>>29,r[15]=this.bytes<<3,this.hash()}},Sha256.prototype.hash=function(){var r=this.h0,x=this.h1,e=this.h2,t=this.h3,i=this.h4,c=this.h5,f=this.h6,a=this.h7,o=this.blocks,d,h,b,l,u,w,A,C,L,P,O;for(d=16;d<64;++d)u=o[d-15],h=(u>>>7|u<<25)^(u>>>18|u<<14)^u>>>3,u=o[d-2],b=(u>>>17|u<<15)^(u>>>19|u<<13)^u>>>10,o[d]=o[d-16]+h+o[d-7]+b<<0;for(O=x&e,d=0;d<64;d+=4)this.first?(this.is224?(C=300032,u=o[0]-1413257819,a=u-150054599<<0,t=u+24177077<<0):(C=704751109,u=o[0]-210244248,a=u-1521486534<<0,t=u+143694565<<0),this.first=!1):(h=(r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10),b=(i>>>6|i<<26)^(i>>>11|i<<21)^(i>>>25|i<<7),C=r&x,l=C^r&e^O,A=i&c^~i&f,u=a+b+A+K[d]+o[d],w=h+l,a=t+u<<0,t=u+w<<0),h=(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10),b=(a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7),L=t&r,l=L^t&x^C,A=a&i^~a&c,u=f+b+A+K[d+1]+o[d+1],w=h+l,f=e+u<<0,e=u+w<<0,h=(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10),b=(f>>>6|f<<26)^(f>>>11|f<<21)^(f>>>25|f<<7),P=e&t,l=P^e&r^L,A=f&a^~f&i,u=c+b+A+K[d+2]+o[d+2],w=h+l,c=x+u<<0,x=u+w<<0,h=(x>>>2|x<<30)^(x>>>13|x<<19)^(x>>>22|x<<10),b=(c>>>6|c<<26)^(c>>>11|c<<21)^(c>>>25|c<<7),O=x&e,l=O^x&t^P,A=c&f^~c&a,u=i+b+A+K[d+3]+o[d+3],w=h+l,i=r+u<<0,r=u+w<<0;this.h0=this.h0+r<<0,this.h1=this.h1+x<<0,this.h2=this.h2+e<<0,this.h3=this.h3+t<<0,this.h4=this.h4+i<<0,this.h5=this.h5+c<<0,this.h6=this.h6+f<<0,this.h7=this.h7+a<<0},Sha256.prototype.hex=function(){this.finalize();var r=this.h0,x=this.h1,e=this.h2,t=this.h3,i=this.h4,c=this.h5,f=this.h6,a=this.h7,o=HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>4&15]+HEX_CHARS[r&15]+HEX_CHARS[x>>28&15]+HEX_CHARS[x>>24&15]+HEX_CHARS[x>>20&15]+HEX_CHARS[x>>16&15]+HEX_CHARS[x>>12&15]+HEX_CHARS[x>>8&15]+HEX_CHARS[x>>4&15]+HEX_CHARS[x&15]+HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>4&15]+HEX_CHARS[e&15]+HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[t&15]+HEX_CHARS[i>>28&15]+HEX_CHARS[i>>24&15]+HEX_CHARS[i>>20&15]+HEX_CHARS[i>>16&15]+HEX_CHARS[i>>12&15]+HEX_CHARS[i>>8&15]+HEX_CHARS[i>>4&15]+HEX_CHARS[i&15]+HEX_CHARS[c>>28&15]+HEX_CHARS[c>>24&15]+HEX_CHARS[c>>20&15]+HEX_CHARS[c>>16&15]+HEX_CHARS[c>>12&15]+HEX_CHARS[c>>8&15]+HEX_CHARS[c>>4&15]+HEX_CHARS[c&15]+HEX_CHARS[f>>28&15]+HEX_CHARS[f>>24&15]+HEX_CHARS[f>>20&15]+HEX_CHARS[f>>16&15]+HEX_CHARS[f>>12&15]+HEX_CHARS[f>>8&15]+HEX_CHARS[f>>4&15]+HEX_CHARS[f&15];return this.is224||(o+=HEX_CHARS[a>>28&15]+HEX_CHARS[a>>24&15]+HEX_CHARS[a>>20&15]+HEX_CHARS[a>>16&15]+HEX_CHARS[a>>12&15]+HEX_CHARS[a>>8&15]+HEX_CHARS[a>>4&15]+HEX_CHARS[a&15]),o},Sha256.prototype.toString=Sha256.prototype.hex,Sha256.prototype.digest=function(){this.finalize();var r=this.h0,x=this.h1,e=this.h2,t=this.h3,i=this.h4,c=this.h5,f=this.h6,a=this.h7,o=[r>>24&255,r>>16&255,r>>8&255,r&255,x>>24&255,x>>16&255,x>>8&255,x&255,e>>24&255,e>>16&255,e>>8&255,e&255,t>>24&255,t>>16&255,t>>8&255,t&255,i>>24&255,i>>16&255,i>>8&255,i&255,c>>24&255,c>>16&255,c>>8&255,c&255,f>>24&255,f>>16&255,f>>8&255,f&255];return this.is224||o.push(a>>24&255,a>>16&255,a>>8&255,a&255),o},Sha256.prototype.array=Sha256.prototype.digest,Sha256.prototype.arrayBuffer=function(){this.finalize();var r=new ArrayBuffer(this.is224?28:32),x=new DataView(r);return x.setUint32(0,this.h0),x.setUint32(4,this.h1),x.setUint32(8,this.h2),x.setUint32(12,this.h3),x.setUint32(16,this.h4),x.setUint32(20,this.h5),x.setUint32(24,this.h6),this.is224||x.setUint32(28,this.h7),r};function HmacSha256(r,x,e){var t,i=typeof r;if(i==="string"){var c=[],f=r.length,a=0,o;for(t=0;t<f;++t)o=r.charCodeAt(t),o<128?c[a++]=o:o<2048?(c[a++]=192|o>>6,c[a++]=128|o&63):o<55296||o>=57344?(c[a++]=224|o>>12,c[a++]=128|o>>6&63,c[a++]=128|o&63):(o=65536+((o&1023)<<10|r.charCodeAt(++t)&1023),c[a++]=240|o>>18,c[a++]=128|o>>12&63,c[a++]=128|o>>6&63,c[a++]=128|o&63);r=c}else if(i==="object"){if(r===null)throw new Error(ERROR);if(ARRAY_BUFFER&&r.constructor===ArrayBuffer)r=new Uint8Array(r);else if(!Array.isArray(r)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(r)))throw new Error(ERROR)}else throw new Error(ERROR);r.length>64&&(r=new Sha256(x,!0).update(r).array());var d=[],h=[];for(t=0;t<64;++t){var b=r[t]||0;d[t]=92^b,h[t]=54^b}Sha256.call(this,x,e),this.update(h),this.oKeyPad=d,this.inner=!0,this.sharedMemory=e}HmacSha256.prototype=new Sha256,HmacSha256.prototype.finalize=function(){if(Sha256.prototype.finalize.call(this),this.inner){this.inner=!1;var r=this.array();Sha256.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(r),Sha256.prototype.finalize.call(this)}};var exports=createMethod();exports.sha256=exports,exports.sha224=createMethod(!0),exports.sha256.hmac=createHmacMethod(),exports.sha224.hmac=createHmacMethod(!0),COMMON_JS?module.exports=exports:(root.sha256=exports.sha256,root.sha224=exports.sha224,AMD&&define(function(){return exports}))})()});var u0=M(N=>{"use strict";N.byteLength=tx;N.toByteArray=cx;N.fromByteArray=ax;var F=[],E=[],rx=typeof Uint8Array<"u"?Uint8Array:Array,W="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(g=0,b0=W.length;g<b0;++g)F[g]=W[g],E[W.charCodeAt(g)]=g;var g,b0;E["-".charCodeAt(0)]=62;E["_".charCodeAt(0)]=63;function h0(r){var x=r.length;if(x%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var e=r.indexOf("=");e===-1&&(e=x);var t=e===x?0:4-e%4;return[e,t]}function tx(r){var x=h0(r),e=x[0],t=x[1];return(e+t)*3/4-t}function ix(r,x,e){return(x+e)*3/4-e}function cx(r){var x,e=h0(r),t=e[0],i=e[1],c=new rx(ix(r,t,i)),f=0,a=i>0?t-4:t,o;for(o=0;o<a;o+=4)x=E[r.charCodeAt(o)]<<18|E[r.charCodeAt(o+1)]<<12|E[r.charCodeAt(o+2)]<<6|E[r.charCodeAt(o+3)],c[f++]=x>>16&255,c[f++]=x>>8&255,c[f++]=x&255;return i===2&&(x=E[r.charCodeAt(o)]<<2|E[r.charCodeAt(o+1)]>>4,c[f++]=x&255),i===1&&(x=E[r.charCodeAt(o)]<<10|E[r.charCodeAt(o+1)]<<4|E[r.charCodeAt(o+2)]>>2,c[f++]=x>>8&255,c[f++]=x&255),c}function fx(r){return F[r>>18&63]+F[r>>12&63]+F[r>>6&63]+F[r&63]}function nx(r,x,e){for(var t,i=[],c=x;c<e;c+=3)t=(r[c]<<16&16711680)+(r[c+1]<<8&65280)+(r[c+2]&255),i.push(fx(t));return i.join("")}function ax(r){for(var x,e=r.length,t=e%3,i=[],c=16383,f=0,a=e-t;f<a;f+=c)i.push(nx(r,f,f+c>a?a:f+c));return t===1?(x=r[e-1],i.push(F[x>>2]+F[x<<4&63]+"==")):t===2&&(x=(r[e-2]<<8)+r[e-1],i.push(F[x>>10]+F[x>>4&63]+F[x<<2&63]+"=")),i.join("")}});var s0=M(Y=>{Y.read=function(r,x,e,t,i){var c,f,a=i*8-t-1,o=(1<<a)-1,d=o>>1,h=-7,b=e?i-1:0,l=e?-1:1,u=r[x+b];for(b+=l,c=u&(1<<-h)-1,u>>=-h,h+=a;h>0;c=c*256+r[x+b],b+=l,h-=8);for(f=c&(1<<-h)-1,c>>=-h,h+=t;h>0;f=f*256+r[x+b],b+=l,h-=8);if(c===0)c=1-d;else{if(c===o)return f?NaN:(u?-1:1)*(1/0);f=f+Math.pow(2,t),c=c-d}return(u?-1:1)*f*Math.pow(2,c-t)};Y.write=function(r,x,e,t,i,c){var f,a,o,d=c*8-i-1,h=(1<<d)-1,b=h>>1,l=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,u=t?0:c-1,w=t?1:-1,A=x<0||x===0&&1/x<0?1:0;for(x=Math.abs(x),isNaN(x)||x===1/0?(a=isNaN(x)?1:0,f=h):(f=Math.floor(Math.log(x)/Math.LN2),x*(o=Math.pow(2,-f))<1&&(f--,o*=2),f+b>=1?x+=l/o:x+=l*Math.pow(2,1-b),x*o>=2&&(f++,o/=2),f+b>=h?(a=0,f=h):f+b>=1?(a=(x*o-1)*Math.pow(2,i),f=f+b):(a=x*Math.pow(2,b-1)*Math.pow(2,i),f=0));i>=8;r[e+u]=a&255,u+=w,a/=256,i-=8);for(f=f<<i|a,d+=i;d>0;r[e+u]=f&255,u+=w,f/=256,d-=8);r[e+u-w]|=A*128}});var v=M(U=>{"use strict";var j=u0(),H=s0(),p0=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;U.Buffer=n;U.SlowBuffer=sx;U.INSPECT_MAX_BYTES=50;var k=2147483647;U.kMaxLength=k;n.TYPED_ARRAY_SUPPORT=ox();!n.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function ox(){try{let r=new Uint8Array(1),x={foo:function(){return 42}};return Object.setPrototypeOf(x,Uint8Array.prototype),Object.setPrototypeOf(r,x),r.foo()===42}catch{return!1}}Object.defineProperty(n.prototype,"parent",{enumerable:!0,get:function(){if(!!n.isBuffer(this))return this.buffer}});Object.defineProperty(n.prototype,"offset",{enumerable:!0,get:function(){if(!!n.isBuffer(this))return this.byteOffset}});function B(r){if(r>k)throw new RangeError('The value "'+r+'" is invalid for option "size"');let x=new Uint8Array(r);return Object.setPrototypeOf(x,n.prototype),x}function n(r,x,e){if(typeof r=="number"){if(typeof x=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return q(r)}return E0(r,x,e)}n.poolSize=8192;function E0(r,x,e){if(typeof r=="string")return bx(r,x);if(ArrayBuffer.isView(r))return hx(r);if(r==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);if(m(r,ArrayBuffer)||r&&m(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(m(r,SharedArrayBuffer)||r&&m(r.buffer,SharedArrayBuffer)))return V(r,x,e);if(typeof r=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let t=r.valueOf&&r.valueOf();if(t!=null&&t!==r)return n.from(t,x,e);let i=ux(r);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol.toPrimitive]=="function")return n.from(r[Symbol.toPrimitive]("string"),x,e);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r)}n.from=function(r,x,e){return E0(r,x,e)};Object.setPrototypeOf(n.prototype,Uint8Array.prototype);Object.setPrototypeOf(n,Uint8Array);function A0(r){if(typeof r!="number")throw new TypeError('"size" argument must be of type number');if(r<0)throw new RangeError('The value "'+r+'" is invalid for option "size"')}function dx(r,x,e){return A0(r),r<=0?B(r):x!==void 0?typeof e=="string"?B(r).fill(x,e):B(r).fill(x):B(r)}n.alloc=function(r,x,e){return dx(r,x,e)};function q(r){return A0(r),B(r<0?0:G(r)|0)}n.allocUnsafe=function(r){return q(r)};n.allocUnsafeSlow=function(r){return q(r)};function bx(r,x){if((typeof x!="string"||x==="")&&(x="utf8"),!n.isEncoding(x))throw new TypeError("Unknown encoding: "+x);let e=F0(r,x)|0,t=B(e),i=t.write(r,x);return i!==e&&(t=t.slice(0,i)),t}function J(r){let x=r.length<0?0:G(r.length)|0,e=B(x);for(let t=0;t<x;t+=1)e[t]=r[t]&255;return e}function hx(r){if(m(r,Uint8Array)){let x=new Uint8Array(r);return V(x.buffer,x.byteOffset,x.byteLength)}return J(r)}function V(r,x,e){if(x<0||r.byteLength<x)throw new RangeError('"offset" is outside of buffer bounds');if(r.byteLength<x+(e||0))throw new RangeError('"length" is outside of buffer bounds');let t;return x===void 0&&e===void 0?t=new Uint8Array(r):e===void 0?t=new Uint8Array(r,x):t=new Uint8Array(r,x,e),Object.setPrototypeOf(t,n.prototype),t}function ux(r){if(n.isBuffer(r)){let x=G(r.length)|0,e=B(x);return e.length===0||r.copy(e,0,0,x),e}if(r.length!==void 0)return typeof r.length!="number"||Q(r.length)?B(0):J(r);if(r.type==="Buffer"&&Array.isArray(r.data))return J(r.data)}function G(r){if(r>=k)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+k.toString(16)+" bytes");return r|0}function sx(r){return+r!=r&&(r=0),n.alloc(+r)}n.isBuffer=function(x){return x!=null&&x._isBuffer===!0&&x!==n.prototype};n.compare=function(x,e){if(m(x,Uint8Array)&&(x=n.from(x,x.offset,x.byteLength)),m(e,Uint8Array)&&(e=n.from(e,e.offset,e.byteLength)),!n.isBuffer(x)||!n.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(x===e)return 0;let t=x.length,i=e.length;for(let c=0,f=Math.min(t,i);c<f;++c)if(x[c]!==e[c]){t=x[c],i=e[c];break}return t<i?-1:i<t?1:0};n.isEncoding=function(x){switch(String(x).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};n.concat=function(x,e){if(!Array.isArray(x))throw new TypeError('"list" argument must be an Array of Buffers');if(x.length===0)return n.alloc(0);let t;if(e===void 0)for(e=0,t=0;t<x.length;++t)e+=x[t].length;let i=n.allocUnsafe(e),c=0;for(t=0;t<x.length;++t){let f=x[t];if(m(f,Uint8Array))c+f.length>i.length?(n.isBuffer(f)||(f=n.from(f)),f.copy(i,c)):Uint8Array.prototype.set.call(i,f,c);else if(n.isBuffer(f))f.copy(i,c);else throw new TypeError('"list" argument must be an Array of Buffers');c+=f.length}return i};function F0(r,x){if(n.isBuffer(r))return r.length;if(ArrayBuffer.isView(r)||m(r,ArrayBuffer))return r.byteLength;if(typeof r!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof r);let e=r.length,t=arguments.length>2&&arguments[2]===!0;if(!t&&e===0)return 0;let i=!1;for(;;)switch(x){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":return z(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return U0(r).length;default:if(i)return t?-1:z(r).length;x=(""+x).toLowerCase(),i=!0}}n.byteLength=F0;function px(r,x,e){let t=!1;if((x===void 0||x<0)&&(x=0),x>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,x>>>=0,e<=x))return"";for(r||(r="utf8");;)switch(r){case"hex":return gx(this,x,e);case"utf8":case"utf-8":return B0(this,x,e);case"ascii":return Bx(this,x,e);case"latin1":case"binary":return Ix(this,x,e);case"base64":return Fx(this,x,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Rx(this,x,e);default:if(t)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),t=!0}}n.prototype._isBuffer=!0;function R(r,x,e){let t=r[x];r[x]=r[e],r[e]=t}n.prototype.swap16=function(){let x=this.length;if(x%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<x;e+=2)R(this,e,e+1);return this};n.prototype.swap32=function(){let x=this.length;if(x%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<x;e+=4)R(this,e,e+3),R(this,e+1,e+2);return this};n.prototype.swap64=function(){let x=this.length;if(x%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<x;e+=8)R(this,e,e+7),R(this,e+1,e+6),R(this,e+2,e+5),R(this,e+3,e+4);return this};n.prototype.toString=function(){let x=this.length;return x===0?"":arguments.length===0?B0(this,0,x):px.apply(this,arguments)};n.prototype.toLocaleString=n.prototype.toString;n.prototype.equals=function(x){if(!n.isBuffer(x))throw new TypeError("Argument must be a Buffer");return this===x?!0:n.compare(this,x)===0};n.prototype.inspect=function(){let x="",e=U.INSPECT_MAX_BYTES;return x=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(x+=" ... "),"<Buffer "+x+">"};p0&&(n.prototype[p0]=n.prototype.inspect);n.prototype.compare=function(x,e,t,i,c){if(m(x,Uint8Array)&&(x=n.from(x,x.offset,x.byteLength)),!n.isBuffer(x))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof x);if(e===void 0&&(e=0),t===void 0&&(t=x?x.length:0),i===void 0&&(i=0),c===void 0&&(c=this.length),e<0||t>x.length||i<0||c>this.length)throw new RangeError("out of range index");if(i>=c&&e>=t)return 0;if(i>=c)return-1;if(e>=t)return 1;if(e>>>=0,t>>>=0,i>>>=0,c>>>=0,this===x)return 0;let f=c-i,a=t-e,o=Math.min(f,a),d=this.slice(i,c),h=x.slice(e,t);for(let b=0;b<o;++b)if(d[b]!==h[b]){f=d[b],a=h[b];break}return f<a?-1:a<f?1:0};function m0(r,x,e,t,i){if(r.length===0)return-1;if(typeof e=="string"?(t=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,Q(e)&&(e=i?0:r.length-1),e<0&&(e=r.length+e),e>=r.length){if(i)return-1;e=r.length-1}else if(e<0)if(i)e=0;else return-1;if(typeof x=="string"&&(x=n.from(x,t)),n.isBuffer(x))return x.length===0?-1:l0(r,x,e,t,i);if(typeof x=="number")return x=x&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(r,x,e):Uint8Array.prototype.lastIndexOf.call(r,x,e):l0(r,[x],e,t,i);throw new TypeError("val must be string, number or Buffer")}function l0(r,x,e,t,i){let c=1,f=r.length,a=x.length;if(t!==void 0&&(t=String(t).toLowerCase(),t==="ucs2"||t==="ucs-2"||t==="utf16le"||t==="utf-16le")){if(r.length<2||x.length<2)return-1;c=2,f/=2,a/=2,e/=2}function o(h,b){return c===1?h[b]:h.readUInt16BE(b*c)}let d;if(i){let h=-1;for(d=e;d<f;d++)if(o(r,d)===o(x,h===-1?0:d-h)){if(h===-1&&(h=d),d-h+1===a)return h*c}else h!==-1&&(d-=d-h),h=-1}else for(e+a>f&&(e=f-a),d=e;d>=0;d--){let h=!0;for(let b=0;b<a;b++)if(o(r,d+b)!==o(x,b)){h=!1;break}if(h)return d}return-1}n.prototype.includes=function(x,e,t){return this.indexOf(x,e,t)!==-1};n.prototype.indexOf=function(x,e,t){return m0(this,x,e,t,!0)};n.prototype.lastIndexOf=function(x,e,t){return m0(this,x,e,t,!1)};function lx(r,x,e,t){e=Number(e)||0;let i=r.length-e;t?(t=Number(t),t>i&&(t=i)):t=i;let c=x.length;t>c/2&&(t=c/2);let f;for(f=0;f<t;++f){let a=parseInt(x.substr(f*2,2),16);if(Q(a))return f;r[e+f]=a}return f}function yx(r,x,e,t){return D(z(x,r.length-e),r,e,t)}function wx(r,x,e,t){return D(Ux(x),r,e,t)}function Ex(r,x,e,t){return D(U0(x),r,e,t)}function Ax(r,x,e,t){return D(Cx(x,r.length-e),r,e,t)}n.prototype.write=function(x,e,t,i){if(e===void 0)i="utf8",t=this.length,e=0;else if(t===void 0&&typeof e=="string")i=e,t=this.length,e=0;else if(isFinite(e))e=e>>>0,isFinite(t)?(t=t>>>0,i===void 0&&(i="utf8")):(i=t,t=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let c=this.length-e;if((t===void 0||t>c)&&(t=c),x.length>0&&(t<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let f=!1;for(;;)switch(i){case"hex":return lx(this,x,e,t);case"utf8":case"utf-8":return yx(this,x,e,t);case"ascii":case"latin1":case"binary":return wx(this,x,e,t);case"base64":return Ex(this,x,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ax(this,x,e,t);default:if(f)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),f=!0}};n.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Fx(r,x,e){return x===0&&e===r.length?j.fromByteArray(r):j.fromByteArray(r.slice(x,e))}function B0(r,x,e){e=Math.min(r.length,e);let t=[],i=x;for(;i<e;){let c=r[i],f=null,a=c>239?4:c>223?3:c>191?2:1;if(i+a<=e){let o,d,h,b;switch(a){case 1:c<128&&(f=c);break;case 2:o=r[i+1],(o&192)===128&&(b=(c&31)<<6|o&63,b>127&&(f=b));break;case 3:o=r[i+1],d=r[i+2],(o&192)===128&&(d&192)===128&&(b=(c&15)<<12|(o&63)<<6|d&63,b>2047&&(b<55296||b>57343)&&(f=b));break;case 4:o=r[i+1],d=r[i+2],h=r[i+3],(o&192)===128&&(d&192)===128&&(h&192)===128&&(b=(c&15)<<18|(o&63)<<12|(d&63)<<6|h&63,b>65535&&b<1114112&&(f=b))}}f===null?(f=65533,a=1):f>65535&&(f-=65536,t.push(f>>>10&1023|55296),f=56320|f&1023),t.push(f),i+=a}return mx(t)}var y0=4096;function mx(r){let x=r.length;if(x<=y0)return String.fromCharCode.apply(String,r);let e="",t=0;for(;t<x;)e+=String.fromCharCode.apply(String,r.slice(t,t+=y0));return e}function Bx(r,x,e){let t="";e=Math.min(r.length,e);for(let i=x;i<e;++i)t+=String.fromCharCode(r[i]&127);return t}function Ix(r,x,e){let t="";e=Math.min(r.length,e);for(let i=x;i<e;++i)t+=String.fromCharCode(r[i]);return t}function gx(r,x,e){let t=r.length;(!x||x<0)&&(x=0),(!e||e<0||e>t)&&(e=t);let i="";for(let c=x;c<e;++c)i+=Tx[r[c]];return i}function Rx(r,x,e){let t=r.slice(x,e),i="";for(let c=0;c<t.length-1;c+=2)i+=String.fromCharCode(t[c]+t[c+1]*256);return i}n.prototype.slice=function(x,e){let t=this.length;x=~~x,e=e===void 0?t:~~e,x<0?(x+=t,x<0&&(x=0)):x>t&&(x=t),e<0?(e+=t,e<0&&(e=0)):e>t&&(e=t),e<x&&(e=x);let i=this.subarray(x,e);return Object.setPrototypeOf(i,n.prototype),i};function p(r,x,e){if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+x>e)throw new RangeError("Trying to access beyond buffer length")}n.prototype.readUintLE=n.prototype.readUIntLE=function(x,e,t){x=x>>>0,e=e>>>0,t||p(x,e,this.length);let i=this[x],c=1,f=0;for(;++f<e&&(c*=256);)i+=this[x+f]*c;return i};n.prototype.readUintBE=n.prototype.readUIntBE=function(x,e,t){x=x>>>0,e=e>>>0,t||p(x,e,this.length);let i=this[x+--e],c=1;for(;e>0&&(c*=256);)i+=this[x+--e]*c;return i};n.prototype.readUint8=n.prototype.readUInt8=function(x,e){return x=x>>>0,e||p(x,1,this.length),this[x]};n.prototype.readUint16LE=n.prototype.readUInt16LE=function(x,e){return x=x>>>0,e||p(x,2,this.length),this[x]|this[x+1]<<8};n.prototype.readUint16BE=n.prototype.readUInt16BE=function(x,e){return x=x>>>0,e||p(x,2,this.length),this[x]<<8|this[x+1]};n.prototype.readUint32LE=n.prototype.readUInt32LE=function(x,e){return x=x>>>0,e||p(x,4,this.length),(this[x]|this[x+1]<<8|this[x+2]<<16)+this[x+3]*16777216};n.prototype.readUint32BE=n.prototype.readUInt32BE=function(x,e){return x=x>>>0,e||p(x,4,this.length),this[x]*16777216+(this[x+1]<<16|this[x+2]<<8|this[x+3])};n.prototype.readBigUInt64LE=I(function(x){x=x>>>0,_(x,"offset");let e=this[x],t=this[x+7];(e===void 0||t===void 0)&&T(x,this.length-8);let i=e+this[++x]*2**8+this[++x]*2**16+this[++x]*2**24,c=this[++x]+this[++x]*2**8+this[++x]*2**16+t*2**24;return BigInt(i)+(BigInt(c)<<BigInt(32))});n.prototype.readBigUInt64BE=I(function(x){x=x>>>0,_(x,"offset");let e=this[x],t=this[x+7];(e===void 0||t===void 0)&&T(x,this.length-8);let i=e*2**24+this[++x]*2**16+this[++x]*2**8+this[++x],c=this[++x]*2**24+this[++x]*2**16+this[++x]*2**8+t;return(BigInt(i)<<BigInt(32))+BigInt(c)});n.prototype.readIntLE=function(x,e,t){x=x>>>0,e=e>>>0,t||p(x,e,this.length);let i=this[x],c=1,f=0;for(;++f<e&&(c*=256);)i+=this[x+f]*c;return c*=128,i>=c&&(i-=Math.pow(2,8*e)),i};n.prototype.readIntBE=function(x,e,t){x=x>>>0,e=e>>>0,t||p(x,e,this.length);let i=e,c=1,f=this[x+--i];for(;i>0&&(c*=256);)f+=this[x+--i]*c;return c*=128,f>=c&&(f-=Math.pow(2,8*e)),f};n.prototype.readInt8=function(x,e){return x=x>>>0,e||p(x,1,this.length),this[x]&128?(255-this[x]+1)*-1:this[x]};n.prototype.readInt16LE=function(x,e){x=x>>>0,e||p(x,2,this.length);let t=this[x]|this[x+1]<<8;return t&32768?t|4294901760:t};n.prototype.readInt16BE=function(x,e){x=x>>>0,e||p(x,2,this.length);let t=this[x+1]|this[x]<<8;return t&32768?t|4294901760:t};n.prototype.readInt32LE=function(x,e){return x=x>>>0,e||p(x,4,this.length),this[x]|this[x+1]<<8|this[x+2]<<16|this[x+3]<<24};n.prototype.readInt32BE=function(x,e){return x=x>>>0,e||p(x,4,this.length),this[x]<<24|this[x+1]<<16|this[x+2]<<8|this[x+3]};n.prototype.readBigInt64LE=I(function(x){x=x>>>0,_(x,"offset");let e=this[x],t=this[x+7];(e===void 0||t===void 0)&&T(x,this.length-8);let i=this[x+4]+this[x+5]*2**8+this[x+6]*2**16+(t<<24);return(BigInt(i)<<BigInt(32))+BigInt(e+this[++x]*2**8+this[++x]*2**16+this[++x]*2**24)});n.prototype.readBigInt64BE=I(function(x){x=x>>>0,_(x,"offset");let e=this[x],t=this[x+7];(e===void 0||t===void 0)&&T(x,this.length-8);let i=(e<<24)+this[++x]*2**16+this[++x]*2**8+this[++x];return(BigInt(i)<<BigInt(32))+BigInt(this[++x]*2**24+this[++x]*2**16+this[++x]*2**8+t)});n.prototype.readFloatLE=function(x,e){return x=x>>>0,e||p(x,4,this.length),H.read(this,x,!0,23,4)};n.prototype.readFloatBE=function(x,e){return x=x>>>0,e||p(x,4,this.length),H.read(this,x,!1,23,4)};n.prototype.readDoubleLE=function(x,e){return x=x>>>0,e||p(x,8,this.length),H.read(this,x,!0,52,8)};n.prototype.readDoubleBE=function(x,e){return x=x>>>0,e||p(x,8,this.length),H.read(this,x,!1,52,8)};function y(r,x,e,t,i,c){if(!n.isBuffer(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(x>i||x<c)throw new RangeError('"value" argument is out of bounds');if(e+t>r.length)throw new RangeError("Index out of range")}n.prototype.writeUintLE=n.prototype.writeUIntLE=function(x,e,t,i){if(x=+x,e=e>>>0,t=t>>>0,!i){let a=Math.pow(2,8*t)-1;y(this,x,e,t,a,0)}let c=1,f=0;for(this[e]=x&255;++f<t&&(c*=256);)this[e+f]=x/c&255;return e+t};n.prototype.writeUintBE=n.prototype.writeUIntBE=function(x,e,t,i){if(x=+x,e=e>>>0,t=t>>>0,!i){let a=Math.pow(2,8*t)-1;y(this,x,e,t,a,0)}let c=t-1,f=1;for(this[e+c]=x&255;--c>=0&&(f*=256);)this[e+c]=x/f&255;return e+t};n.prototype.writeUint8=n.prototype.writeUInt8=function(x,e,t){return x=+x,e=e>>>0,t||y(this,x,e,1,255,0),this[e]=x&255,e+1};n.prototype.writeUint16LE=n.prototype.writeUInt16LE=function(x,e,t){return x=+x,e=e>>>0,t||y(this,x,e,2,65535,0),this[e]=x&255,this[e+1]=x>>>8,e+2};n.prototype.writeUint16BE=n.prototype.writeUInt16BE=function(x,e,t){return x=+x,e=e>>>0,t||y(this,x,e,2,65535,0),this[e]=x>>>8,this[e+1]=x&255,e+2};n.prototype.writeUint32LE=n.prototype.writeUInt32LE=function(x,e,t){return x=+x,e=e>>>0,t||y(this,x,e,4,4294967295,0),this[e+3]=x>>>24,this[e+2]=x>>>16,this[e+1]=x>>>8,this[e]=x&255,e+4};n.prototype.writeUint32BE=n.prototype.writeUInt32BE=function(x,e,t){return x=+x,e=e>>>0,t||y(this,x,e,4,4294967295,0),this[e]=x>>>24,this[e+1]=x>>>16,this[e+2]=x>>>8,this[e+3]=x&255,e+4};function I0(r,x,e,t,i){_0(x,t,i,r,e,7);let c=Number(x&BigInt(4294967295));r[e++]=c,c=c>>8,r[e++]=c,c=c>>8,r[e++]=c,c=c>>8,r[e++]=c;let f=Number(x>>BigInt(32)&BigInt(4294967295));return r[e++]=f,f=f>>8,r[e++]=f,f=f>>8,r[e++]=f,f=f>>8,r[e++]=f,e}function g0(r,x,e,t,i){_0(x,t,i,r,e,7);let c=Number(x&BigInt(4294967295));r[e+7]=c,c=c>>8,r[e+6]=c,c=c>>8,r[e+5]=c,c=c>>8,r[e+4]=c;let f=Number(x>>BigInt(32)&BigInt(4294967295));return r[e+3]=f,f=f>>8,r[e+2]=f,f=f>>8,r[e+1]=f,f=f>>8,r[e]=f,e+8}n.prototype.writeBigUInt64LE=I(function(x,e=0){return I0(this,x,e,BigInt(0),BigInt("0xffffffffffffffff"))});n.prototype.writeBigUInt64BE=I(function(x,e=0){return g0(this,x,e,BigInt(0),BigInt("0xffffffffffffffff"))});n.prototype.writeIntLE=function(x,e,t,i){if(x=+x,e=e>>>0,!i){let o=Math.pow(2,8*t-1);y(this,x,e,t,o-1,-o)}let c=0,f=1,a=0;for(this[e]=x&255;++c<t&&(f*=256);)x<0&&a===0&&this[e+c-1]!==0&&(a=1),this[e+c]=(x/f>>0)-a&255;return e+t};n.prototype.writeIntBE=function(x,e,t,i){if(x=+x,e=e>>>0,!i){let o=Math.pow(2,8*t-1);y(this,x,e,t,o-1,-o)}let c=t-1,f=1,a=0;for(this[e+c]=x&255;--c>=0&&(f*=256);)x<0&&a===0&&this[e+c+1]!==0&&(a=1),this[e+c]=(x/f>>0)-a&255;return e+t};n.prototype.writeInt8=function(x,e,t){return x=+x,e=e>>>0,t||y(this,x,e,1,127,-128),x<0&&(x=255+x+1),this[e]=x&255,e+1};n.prototype.writeInt16LE=function(x,e,t){return x=+x,e=e>>>0,t||y(this,x,e,2,32767,-32768),this[e]=x&255,this[e+1]=x>>>8,e+2};n.prototype.writeInt16BE=function(x,e,t){return x=+x,e=e>>>0,t||y(this,x,e,2,32767,-32768),this[e]=x>>>8,this[e+1]=x&255,e+2};n.prototype.writeInt32LE=function(x,e,t){return x=+x,e=e>>>0,t||y(this,x,e,4,2147483647,-2147483648),this[e]=x&255,this[e+1]=x>>>8,this[e+2]=x>>>16,this[e+3]=x>>>24,e+4};n.prototype.writeInt32BE=function(x,e,t){return x=+x,e=e>>>0,t||y(this,x,e,4,2147483647,-2147483648),x<0&&(x=4294967295+x+1),this[e]=x>>>24,this[e+1]=x>>>16,this[e+2]=x>>>8,this[e+3]=x&255,e+4};n.prototype.writeBigInt64LE=I(function(x,e=0){return I0(this,x,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});n.prototype.writeBigInt64BE=I(function(x,e=0){return g0(this,x,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function R0(r,x,e,t,i,c){if(e+t>r.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function S0(r,x,e,t,i){return x=+x,e=e>>>0,i||R0(r,x,e,4,34028234663852886e22,-34028234663852886e22),H.write(r,x,e,t,23,4),e+4}n.prototype.writeFloatLE=function(x,e,t){return S0(this,x,e,!0,t)};n.prototype.writeFloatBE=function(x,e,t){return S0(this,x,e,!1,t)};function H0(r,x,e,t,i){return x=+x,e=e>>>0,i||R0(r,x,e,8,17976931348623157e292,-17976931348623157e292),H.write(r,x,e,t,52,8),e+8}n.prototype.writeDoubleLE=function(x,e,t){return H0(this,x,e,!0,t)};n.prototype.writeDoubleBE=function(x,e,t){return H0(this,x,e,!1,t)};n.prototype.copy=function(x,e,t,i){if(!n.isBuffer(x))throw new TypeError("argument should be a Buffer");if(t||(t=0),!i&&i!==0&&(i=this.length),e>=x.length&&(e=x.length),e||(e=0),i>0&&i<t&&(i=t),i===t||x.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(t<0||t>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),x.length-e<i-t&&(i=x.length-e+t);let c=i-t;return this===x&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(e,t,i):Uint8Array.prototype.set.call(x,this.subarray(t,i),e),c};n.prototype.fill=function(x,e,t,i){if(typeof x=="string"){if(typeof e=="string"?(i=e,e=0,t=this.length):typeof t=="string"&&(i=t,t=this.length),i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!n.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(x.length===1){let f=x.charCodeAt(0);(i==="utf8"&&f<128||i==="latin1")&&(x=f)}}else typeof x=="number"?x=x&255:typeof x=="boolean"&&(x=Number(x));if(e<0||this.length<e||this.length<t)throw new RangeError("Out of range index");if(t<=e)return this;e=e>>>0,t=t===void 0?this.length:t>>>0,x||(x=0);let c;if(typeof x=="number")for(c=e;c<t;++c)this[c]=x;else{let f=n.isBuffer(x)?x:n.from(x,i),a=f.length;if(a===0)throw new TypeError('The value "'+x+'" is invalid for argument "value"');for(c=0;c<t-e;++c)this[c+e]=f[c%a]}return this};var S={};function Z(r,x,e){S[r]=class extends e{constructor(){super(),Object.defineProperty(this,"message",{value:x.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${r}]`,this.stack,delete this.name}get code(){return r}set code(i){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:i,writable:!0})}toString(){return`${this.name} [${r}]: ${this.message}`}}}Z("ERR_BUFFER_OUT_OF_BOUNDS",function(r){return r?`${r} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);Z("ERR_INVALID_ARG_TYPE",function(r,x){return`The "${r}" argument must be of type number. Received type ${typeof x}`},TypeError);Z("ERR_OUT_OF_RANGE",function(r,x,e){let t=`The value of "${r}" is out of range.`,i=e;return Number.isInteger(e)&&Math.abs(e)>2**32?i=w0(String(e)):typeof e=="bigint"&&(i=String(e),(e>BigInt(2)**BigInt(32)||e<-(BigInt(2)**BigInt(32)))&&(i=w0(i)),i+="n"),t+=` It must be ${x}. Received ${i}`,t},RangeError);function w0(r){let x="",e=r.length,t=r[0]==="-"?1:0;for(;e>=t+4;e-=3)x=`_${r.slice(e-3,e)}${x}`;return`${r.slice(0,e)}${x}`}function Sx(r,x,e){_(x,"offset"),(r[x]===void 0||r[x+e]===void 0)&&T(x,r.length-(e+1))}function _0(r,x,e,t,i,c){if(r>e||r<x){let f=typeof x=="bigint"?"n":"",a;throw c>3?x===0||x===BigInt(0)?a=`>= 0${f} and < 2${f} ** ${(c+1)*8}${f}`:a=`>= -(2${f} ** ${(c+1)*8-1}${f}) and < 2 ** ${(c+1)*8-1}${f}`:a=`>= ${x}${f} and <= ${e}${f}`,new S.ERR_OUT_OF_RANGE("value",a,r)}Sx(t,i,c)}function _(r,x){if(typeof r!="number")throw new S.ERR_INVALID_ARG_TYPE(x,"number",r)}function T(r,x,e){throw Math.floor(r)!==r?(_(r,e),new S.ERR_OUT_OF_RANGE(e||"offset","an integer",r)):x<0?new S.ERR_BUFFER_OUT_OF_BOUNDS:new S.ERR_OUT_OF_RANGE(e||"offset",`>= ${e?1:0} and <= ${x}`,r)}var Hx=/[^+/0-9A-Za-z-_]/g;function _x(r){if(r=r.split("=")[0],r=r.trim().replace(Hx,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function z(r,x){x=x||1/0;let e,t=r.length,i=null,c=[];for(let f=0;f<t;++f){if(e=r.charCodeAt(f),e>55295&&e<57344){if(!i){if(e>56319){(x-=3)>-1&&c.push(239,191,189);continue}else if(f+1===t){(x-=3)>-1&&c.push(239,191,189);continue}i=e;continue}if(e<56320){(x-=3)>-1&&c.push(239,191,189),i=e;continue}e=(i-55296<<10|e-56320)+65536}else i&&(x-=3)>-1&&c.push(239,191,189);if(i=null,e<128){if((x-=1)<0)break;c.push(e)}else if(e<2048){if((x-=2)<0)break;c.push(e>>6|192,e&63|128)}else if(e<65536){if((x-=3)<0)break;c.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((x-=4)<0)break;c.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return c}function Ux(r){let x=[];for(let e=0;e<r.length;++e)x.push(r.charCodeAt(e)&255);return x}function Cx(r,x){let e,t,i,c=[];for(let f=0;f<r.length&&!((x-=2)<0);++f)e=r.charCodeAt(f),t=e>>8,i=e%256,c.push(i),c.push(t);return c}function U0(r){return j.toByteArray(_x(r))}function D(r,x,e,t){let i;for(i=0;i<t&&!(i+e>=x.length||i>=r.length);++i)x[i+e]=r[i];return i}function m(r,x){return r instanceof x||r!=null&&r.constructor!=null&&r.constructor.name!=null&&r.constructor.name===x.name}function Q(r){return r!==r}var Tx=function(){let r="0123456789abcdef",x=new Array(256);for(let e=0;e<16;++e){let t=e*16;for(let i=0;i<16;++i)x[t+i]=r[e]+r[i]}return x}();function I(r){return typeof BigInt>"u"?Xx:r}function Xx(){throw new Error("BigInt not supported")}});var X=$(v());var Ox=(r,x=0)=>{let e=~~x,t=0;for(let i=0;i<r.length;i++)t+=r[i];return e+=t%256,e%256},C0=Ox;var T0=$(v(),1),Mx=(r,x)=>T0.Buffer.from(r,x),x0=Mx;function s(r,x){let e=(t,i)=>x(x0(t),i)>>>0;return e.signed=(t,i)=>x(x0(t),i),e.unsigned=e,e.model=r,e}var X0=s("crc1",C0);var e0=[0,7,14,9,28,27,18,21,56,63,54,49,36,35,42,45,112,119,126,121,108,107,98,101,72,79,70,65,84,83,90,93,224,231,238,233,252,251,242,245,216,223,214,209,196,195,202,205,144,151,158,153,140,139,130,133,168,175,166,161,180,179,186,189,199,192,201,206,219,220,213,210,255,248,241,246,227,228,237,234,183,176,185,190,171,172,165,162,143,136,129,134,147,148,157,154,39,32,41,46,59,60,53,50,31,24,17,22,3,4,13,10,87,80,89,94,75,76,69,66,111,104,97,102,115,116,125,122,137,142,135,128,149,146,155,156,177,182,191,184,173,170,163,164,249,254,247,240,229,226,235,236,193,198,207,200,221,218,211,212,105,110,103,96,117,114,123,124,81,86,95,88,77,74,67,68,25,30,23,16,5,2,11,12,33,38,47,40,61,58,51,52,78,73,64,71,82,85,92,91,118,113,120,127,106,109,100,99,62,57,48,55,34,37,44,43,6,1,8,15,26,29,20,19,174,169,160,167,178,181,188,187,150,145,152,159,138,141,132,131,222,217,208,215,194,197,204,203,230,225,232,239,250,253,244,243];typeof Int32Array<"u"&&(e0=new Int32Array(e0));var Nx=(r,x=0)=>{let e=~~x;for(let t=0;t<r.length;t++)e=e0[(e^r[t])&255]&255;return e},O0=Nx;var M0=s("crc-8",O0);var r0=[0,94,188,226,97,63,221,131,194,156,126,32,163,253,31,65,157,195,33,127,252,162,64,30,95,1,227,189,62,96,130,220,35,125,159,193,66,28,254,160,225,191,93,3,128,222,60,98,190,224,2,92,223,129,99,61,124,34,192,158,29,67,161,255,70,24,250,164,39,121,155,197,132,218,56,102,229,187,89,7,219,133,103,57,186,228,6,88,25,71,165,251,120,38,196,154,101,59,217,135,4,90,184,230,167,249,27,69,198,152,122,36,248,166,68,26,153,199,37,123,58,100,134,216,91,5,231,185,140,210,48,110,237,179,81,15,78,16,242,172,47,113,147,205,17,79,173,243,112,46,204,146,211,141,111,49,178,236,14,80,175,241,19,77,206,144,114,44,109,51,209,143,12,82,176,238,50,108,142,208,83,13,239,177,240,174,76,18,145,207,45,115,202,148,118,40,171,245,23,73,8,86,180,234,105,55,213,139,87,9,235,181,54,104,138,212,149,203,41,119,244,170,72,22,233,183,85,11,136,214,52,106,43,117,151,201,74,20,246,168,116,42,200,150,21,75,169,247,182,232,10,84,215,137,107,53];typeof Int32Array<"u"&&(r0=new Int32Array(r0));var kx=(r,x=0)=>{let e=~~x;for(let t=0;t<r.length;t++)e=r0[(e^r[t])&255]&255;return e},N0=kx;var k0=s("dallas-1-wire",N0);var t0=[0,49345,49537,320,49921,960,640,49729,50689,1728,1920,51009,1280,50625,50305,1088,52225,3264,3456,52545,3840,53185,52865,3648,2560,51905,52097,2880,51457,2496,2176,51265,55297,6336,6528,55617,6912,56257,55937,6720,7680,57025,57217,8e3,56577,7616,7296,56385,5120,54465,54657,5440,55041,6080,5760,54849,53761,4800,4992,54081,4352,53697,53377,4160,61441,12480,12672,61761,13056,62401,62081,12864,13824,63169,63361,14144,62721,13760,13440,62529,15360,64705,64897,15680,65281,16320,16e3,65089,64001,15040,15232,64321,14592,63937,63617,14400,10240,59585,59777,10560,60161,11200,10880,59969,60929,11968,12160,61249,11520,60865,60545,11328,58369,9408,9600,58689,9984,59329,59009,9792,8704,58049,58241,9024,57601,8640,8320,57409,40961,24768,24960,41281,25344,41921,41601,25152,26112,42689,42881,26432,42241,26048,25728,42049,27648,44225,44417,27968,44801,28608,28288,44609,43521,27328,27520,43841,26880,43457,43137,26688,30720,47297,47489,31040,47873,31680,31360,47681,48641,32448,32640,48961,32e3,48577,48257,31808,46081,29888,30080,46401,30464,47041,46721,30272,29184,45761,45953,29504,45313,29120,28800,45121,20480,37057,37249,20800,37633,21440,21120,37441,38401,22208,22400,38721,21760,38337,38017,21568,39937,23744,23936,40257,24320,40897,40577,24128,23040,39617,39809,23360,39169,22976,22656,38977,34817,18624,18816,35137,19200,35777,35457,19008,19968,36545,36737,20288,36097,19904,19584,35905,17408,33985,34177,17728,34561,18368,18048,34369,33281,17088,17280,33601,16640,33217,32897,16448];typeof Int32Array<"u"&&(t0=new Int32Array(t0));var Dx=(r,x=0)=>{let e=~~x;for(let t=0;t<r.length;t++)e=(t0[(e^r[t])&255]^e>>8)&65535;return e},D0=Dx;var L0=s("crc-16",D0);var i0=[0,4129,8258,12387,16516,20645,24774,28903,33032,37161,41290,45419,49548,53677,57806,61935,4657,528,12915,8786,21173,17044,29431,25302,37689,33560,45947,41818,54205,50076,62463,58334,9314,13379,1056,5121,25830,29895,17572,21637,42346,46411,34088,38153,58862,62927,50604,54669,13907,9842,5649,1584,30423,26358,22165,18100,46939,42874,38681,34616,63455,59390,55197,51132,18628,22757,26758,30887,2112,6241,10242,14371,51660,55789,59790,63919,35144,39273,43274,47403,23285,19156,31415,27286,6769,2640,14899,10770,56317,52188,64447,60318,39801,35672,47931,43802,27814,31879,19684,23749,11298,15363,3168,7233,60846,64911,52716,56781,44330,48395,36200,40265,32407,28342,24277,20212,15891,11826,7761,3696,65439,61374,57309,53244,48923,44858,40793,36728,37256,33193,45514,41451,53516,49453,61774,57711,4224,161,12482,8419,20484,16421,28742,24679,33721,37784,41979,46042,49981,54044,58239,62302,689,4752,8947,13010,16949,21012,25207,29270,46570,42443,38312,34185,62830,58703,54572,50445,13538,9411,5280,1153,29798,25671,21540,17413,42971,47098,34713,38840,59231,63358,50973,55100,9939,14066,1681,5808,26199,30326,17941,22068,55628,51565,63758,59695,39368,35305,47498,43435,22596,18533,30726,26663,6336,2273,14466,10403,52093,56156,60223,64286,35833,39896,43963,48026,19061,23124,27191,31254,2801,6864,10931,14994,64814,60687,56684,52557,48554,44427,40424,36297,31782,27655,23652,19525,15522,11395,7392,3265,61215,65342,53085,57212,44955,49082,36825,40952,28183,32310,20053,24180,11923,16050,3793,7920];typeof Int32Array<"u"&&(i0=new Int32Array(i0));var Lx=(r,x)=>{let e=typeof x<"u"?~~x:65535;for(let t=0;t<r.length;t++)e=(i0[(e>>8^r[t])&255]^e<<8)&65535;return e},P0=Lx;var $0=s("ccitt",P0);var c0=[0,49345,49537,320,49921,960,640,49729,50689,1728,1920,51009,1280,50625,50305,1088,52225,3264,3456,52545,3840,53185,52865,3648,2560,51905,52097,2880,51457,2496,2176,51265,55297,6336,6528,55617,6912,56257,55937,6720,7680,57025,57217,8e3,56577,7616,7296,56385,5120,54465,54657,5440,55041,6080,5760,54849,53761,4800,4992,54081,4352,53697,53377,4160,61441,12480,12672,61761,13056,62401,62081,12864,13824,63169,63361,14144,62721,13760,13440,62529,15360,64705,64897,15680,65281,16320,16e3,65089,64001,15040,15232,64321,14592,63937,63617,14400,10240,59585,59777,10560,60161,11200,10880,59969,60929,11968,12160,61249,11520,60865,60545,11328,58369,9408,9600,58689,9984,59329,59009,9792,8704,58049,58241,9024,57601,8640,8320,57409,40961,24768,24960,41281,25344,41921,41601,25152,26112,42689,42881,26432,42241,26048,25728,42049,27648,44225,44417,27968,44801,28608,28288,44609,43521,27328,27520,43841,26880,43457,43137,26688,30720,47297,47489,31040,47873,31680,31360,47681,48641,32448,32640,48961,32e3,48577,48257,31808,46081,29888,30080,46401,30464,47041,46721,30272,29184,45761,45953,29504,45313,29120,28800,45121,20480,37057,37249,20800,37633,21440,21120,37441,38401,22208,22400,38721,21760,38337,38017,21568,39937,23744,23936,40257,24320,40897,40577,24128,23040,39617,39809,23360,39169,22976,22656,38977,34817,18624,18816,35137,19200,35777,35457,19008,19968,36545,36737,20288,36097,19904,19584,35905,17408,33985,34177,17728,34561,18368,18048,34369,33281,17088,17280,33601,16640,33217,32897,16448];typeof Int32Array<"u"&&(c0=new Int32Array(c0));var Px=(r,x)=>{let e=typeof x<"u"?~~x:65535;for(let t=0;t<r.length;t++)e=(c0[(e^r[t])&255]^e>>8)&65535;return e},W0=Px;var Y0=s("crc-16-modbus",W0);var $x=(r,x)=>{let e=typeof x<"u"?~~x:0;for(let t=0;t<r.length;t++){let i=e>>>8&255;i^=r[t]&255,i^=i>>>4,e=e<<8&65535,e^=i,i=i<<5&65535,e^=i,i=i<<7&65535,e^=i}return e},j0=$x;var J0=s("xmodem",j0);var f0=[0,4489,8978,12955,17956,22445,25910,29887,35912,40385,44890,48851,51820,56293,59774,63735,4225,264,13203,8730,22181,18220,30135,25662,40137,36160,49115,44626,56045,52068,63999,59510,8450,12427,528,5017,26406,30383,17460,21949,44362,48323,36440,40913,60270,64231,51324,55797,12675,8202,4753,792,30631,26158,21685,17724,48587,44098,40665,36688,64495,60006,55549,51572,16900,21389,24854,28831,1056,5545,10034,14011,52812,57285,60766,64727,34920,39393,43898,47859,21125,17164,29079,24606,5281,1320,14259,9786,57037,53060,64991,60502,39145,35168,48123,43634,25350,29327,16404,20893,9506,13483,1584,6073,61262,65223,52316,56789,43370,47331,35448,39921,29575,25102,20629,16668,13731,9258,5809,1848,65487,60998,56541,52564,47595,43106,39673,35696,33800,38273,42778,46739,49708,54181,57662,61623,2112,6601,11090,15067,20068,24557,28022,31999,38025,34048,47003,42514,53933,49956,61887,57398,6337,2376,15315,10842,24293,20332,32247,27774,42250,46211,34328,38801,58158,62119,49212,53685,10562,14539,2640,7129,28518,32495,19572,24061,46475,41986,38553,34576,62383,57894,53437,49460,14787,10314,6865,2904,32743,28270,23797,19836,50700,55173,58654,62615,32808,37281,41786,45747,19012,23501,26966,30943,3168,7657,12146,16123,54925,50948,62879,58390,37033,33056,46011,41522,23237,19276,31191,26718,7393,3432,16371,11898,59150,63111,50204,54677,41258,45219,33336,37809,27462,31439,18516,23005,11618,15595,3696,8185,63375,58886,54429,50452,45483,40994,37561,33584,31687,27214,22741,18780,15843,11370,7921,3960];typeof Int32Array<"u"&&(f0=new Int32Array(f0));var Wx=(r,x)=>{let e=typeof x<"u"?~~x:0;for(let t=0;t<r.length;t++)e=(f0[(e^r[t])&255]^e>>8)&65535;return e},V0=Wx;var z0=s("kermit",V0);var n0=[0,8801531,9098509,825846,9692897,1419802,1651692,10452759,10584377,2608578,2839604,11344079,3303384,11807523,12104405,4128302,12930697,4391538,5217156,13227903,5679208,13690003,14450021,5910942,6606768,14844747,15604413,6837830,16197969,7431594,8256604,16494759,840169,9084178,8783076,18463,10434312,1670131,1434117,9678590,11358416,2825259,2590173,10602790,4109873,12122826,11821884,3289031,13213536,5231515,4409965,12912278,5929345,14431610,13675660,5693559,6823513,15618722,14863188,6588335,16513208,8238147,7417269,16212302,1680338,10481449,9664223,1391140,9061683,788936,36926,8838341,12067563,4091408,3340262,11844381,2868234,11372785,10555655,2579964,14478683,5939616,5650518,13661357,5180346,13190977,12967607,4428364,8219746,16457881,16234863,7468436,15633027,6866552,6578062,14816117,1405499,9649856,10463030,1698765,8819930,55329,803287,9047340,11858690,3325945,4072975,12086004,2561507,10574104,11387118,2853909,13647026,5664841,5958079,14460228,4446803,12949160,13176670,5194661,7454091,16249200,16476294,8201341,14834538,6559633,6852199,15647388,3360676,11864927,12161705,4185682,10527045,2551230,2782280,11286707,9619101,1346150,1577872,10379115,73852,8875143,9172337,899466,16124205,7357910,8182816,16421083,6680524,14918455,15678145,6911546,5736468,13747439,14507289,5968354,12873461,4334094,5159928,13170435,4167245,12180150,11879232,3346363,11301036,2767959,2532769,10545498,10360692,1596303,1360505,9604738,913813,9157998,8856728,92259,16439492,8164415,7343561,16138546,6897189,15692510,14936872,6662099,5986813,14488838,13733104,5750795,13156124,5174247,4352529,12855018,2810998,11315341,10498427,2522496,12124823,4148844,3397530,11901793,9135439,862644,110658,8912057,1606574,10407765,9590435,1317464,15706879,6940164,6651890,14889737,8145950,16384229,16161043,7394792,5123014,13133629,12910283,4370992,14535975,5997020,5707818,13718737,2504095,10516836,11329682,2796649,11916158,3383173,4130419,12143240,8893606,129117,876971,9121104,1331783,9576124,10389322,1625009,14908182,6633453,6925851,15721184,7380471,16175372,16402682,8127489,4389423,12891860,13119266,5137369,13704398,5722165,6015427,14517560];typeof Int32Array<"u"&&(n0=new Int32Array(n0));var Yx=(r,x)=>{let e=typeof x<"u"?~~x:11994318;for(let t=0;t<r.length;t++)e=(n0[(e>>16^r[t])&255]^e<<8)&16777215;return e},K0=Yx;var q0=s("crc-24",K0);var a0=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];typeof Int32Array<"u"&&(a0=new Int32Array(a0));var jx=(r,x)=>{let e=x===0?0:~~x^-1;for(let t=0;t<r.length;t++)e=a0[(e^r[t])&255]^e>>>8;return e^-1},G0=jx;var Z0=s("crc-32",G0);var o0=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];typeof Int32Array<"u"&&(o0=new Int32Array(o0));var Jx=(r,x=-1)=>{let e=x===0?0:~~x;for(let t=0;t<r.length;t++)e=o0[(e^r[t])&255]^e>>>8;return e},Q0=Jx;var v0=s("jam",Q0);var xx={crc1:X0,crc8:M0,crc81wire:k0,crc16:L0,crc16ccitt:$0,crc16modbus:Y0,crc16xmodem:J0,crc16kermit:z0,crc24:q0,crc32:Z0,crcjam:v0};var ex=$(d0()),fr=r=>{let x=new DataView(r.buffer,r.byteOffset,r.byteLength);if(typeof x.getBigUint64=="function")return x.getBigUint64(0);{let e=BigInt(x.getUint32(0)),t=BigInt(x.getUint32(4));return(e<<BigInt(32))+t}},nr=r=>{let x=new Uint8Array(r);return Array.from(x)},Vx=r=>new Uint8Array(r),ar=r=>Vx(r).buffer,or=(r,x)=>{let e=new ArrayBuffer(x);return new DataView(e).setUint32(x-4,r),e},zx=r=>Array.from(r).map(x=>x.charCodeAt(0)),dr=r=>Uint8Array.from(X.Buffer.from(r,"hex")).subarray(4),br=r=>X.Buffer.from(r).toString("hex"),hr=(r,x)=>{let e=zx(`
2
- account-id`),t=ex.sha224.create();t.update([...e,...r.toUint8Array(),...x??Array(32).fill(0)]);let i=new Uint8Array(t.array()),c=qx(i),f=new Uint8Array([...c,...i]);return Kx(f)},Kx=r=>r.reduce((x,e)=>x+e.toString(16).padStart(2,"0"),""),qx=r=>{let x=new ArrayBuffer(4);return new DataView(x).setUint32(0,xx.crc32(X.Buffer.from(r)),!1),X.Buffer.from(x)};export{d0 as a,u0 as b,s0 as c,v as d,fr as e,nr as f,Vx as g,ar as h,or as i,zx as j,dr as k,br as l,hr as m,Kx as n,qx as o};
3
- /*!
4
- * The buffer module from node.js, for the browser.
5
- *
6
- * @author Feross Aboukhadijeh <https://feross.org>
7
- * @license MIT
8
- */
9
- /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
10
- /**
11
- * [js-sha256]{@link https://github.com/emn178/js-sha256}
12
- *
13
- * @version 0.9.0
14
- * @author Chen, Yi-Cyuan [emn178@gmail.com]
15
- * @copyright Chen, Yi-Cyuan 2014-2017
16
- * @license MIT
17
- */
18
- //# sourceMappingURL=chunk-BRAPLAM7.js.map