@bananapus/nana-sdk-core 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/actions/JBSuckerAbi.d.ts +32 -0
- package/dist/cjs/actions/JBSuckerAbi.d.ts.map +1 -0
- package/dist/cjs/actions/JBSuckerAbi.js +42 -0
- package/dist/cjs/actions/JBSuckerAbi.js.map +1 -0
- package/dist/cjs/actions/dataHook.d.ts +29 -0
- package/dist/cjs/actions/dataHook.d.ts.map +1 -0
- package/dist/cjs/actions/dataHook.js +81 -0
- package/dist/cjs/actions/dataHook.js.map +1 -0
- package/dist/cjs/actions/projectMetadata.d.ts +16 -0
- package/dist/cjs/actions/projectMetadata.d.ts.map +1 -0
- package/dist/cjs/actions/projectMetadata.js +37 -0
- package/dist/cjs/actions/projectMetadata.js.map +1 -0
- package/dist/cjs/actions/suckerPairs.d.ts +19 -0
- package/dist/cjs/actions/suckerPairs.d.ts.map +1 -0
- package/dist/cjs/actions/suckerPairs.js +71 -0
- package/dist/cjs/actions/suckerPairs.js.map +1 -0
- package/dist/cjs/constants.d.ts +126 -0
- package/dist/cjs/constants.d.ts.map +1 -0
- package/dist/cjs/constants.js +229 -0
- package/dist/cjs/constants.js.map +1 -0
- package/dist/cjs/contracts.d.ts +71 -0
- package/dist/cjs/contracts.d.ts.map +1 -0
- package/dist/cjs/contracts.js +78 -0
- package/dist/cjs/contracts.js.map +1 -0
- package/dist/cjs/generated/juicebox.d.ts +79672 -0
- package/dist/cjs/generated/juicebox.d.ts.map +1 -0
- package/dist/cjs/generated/juicebox.js +62354 -0
- package/dist/cjs/generated/juicebox.js.map +1 -0
- package/dist/cjs/index.d.ts +9 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +9 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/types.d.ts +120 -0
- package/dist/cjs/types.d.ts.map +1 -0
- package/dist/cjs/types.js +31 -0
- package/dist/cjs/types.js.map +1 -0
- package/dist/cjs/utils/contracts.d.ts +10 -0
- package/dist/cjs/utils/contracts.d.ts.map +1 -0
- package/dist/cjs/utils/contracts.js +28 -0
- package/dist/cjs/utils/contracts.js.map +1 -0
- package/dist/cjs/utils/data.d.ts +69 -0
- package/dist/cjs/utils/data.d.ts.map +1 -0
- package/dist/cjs/utils/data.js +80 -0
- package/dist/cjs/utils/data.js.map +1 -0
- package/dist/cjs/utils/data.test.d.ts +2 -0
- package/dist/cjs/utils/data.test.d.ts.map +1 -0
- package/dist/cjs/utils/data.test.js +25 -0
- package/dist/cjs/utils/data.test.js.map +1 -0
- package/dist/cjs/utils/debug.d.ts +2 -0
- package/dist/cjs/utils/debug.d.ts.map +1 -0
- package/dist/cjs/utils/debug.js +11 -0
- package/dist/cjs/utils/debug.js.map +1 -0
- package/dist/cjs/utils/deploy.d.ts +32 -0
- package/dist/cjs/utils/deploy.d.ts.map +1 -0
- package/dist/cjs/utils/deploy.js +62 -0
- package/dist/cjs/utils/deploy.js.map +1 -0
- package/dist/cjs/utils/deploy.test.d.ts +2 -0
- package/dist/cjs/utils/deploy.test.d.ts.map +1 -0
- package/dist/cjs/utils/deploy.test.js +22 -0
- package/dist/cjs/utils/deploy.test.js.map +1 -0
- package/dist/cjs/utils/fee.d.ts +2 -0
- package/dist/cjs/utils/fee.d.ts.map +1 -0
- package/dist/cjs/utils/fee.js +5 -0
- package/dist/cjs/utils/fee.js.map +1 -0
- package/dist/cjs/utils/fee.test.d.ts +2 -0
- package/dist/cjs/utils/fee.test.d.ts.map +1 -0
- package/dist/cjs/utils/fee.test.js +9 -0
- package/dist/cjs/utils/fee.test.js.map +1 -0
- package/dist/cjs/utils/format.d.ts +33 -0
- package/dist/cjs/utils/format.d.ts.map +1 -0
- package/dist/cjs/utils/format.js +48 -0
- package/dist/cjs/utils/format.js.map +1 -0
- package/dist/cjs/utils/format.test.d.ts +2 -0
- package/dist/cjs/utils/format.test.d.ts.map +1 -0
- package/dist/cjs/utils/format.test.js +25 -0
- package/dist/cjs/utils/format.test.js.map +1 -0
- package/dist/cjs/utils/hook.d.ts +9 -0
- package/dist/cjs/utils/hook.d.ts.map +1 -0
- package/dist/cjs/utils/hook.js +44 -0
- package/dist/cjs/utils/hook.js.map +1 -0
- package/dist/cjs/utils/index.d.ts +13 -0
- package/dist/cjs/utils/index.d.ts.map +1 -0
- package/dist/cjs/utils/index.js +13 -0
- package/dist/cjs/utils/index.js.map +1 -0
- package/dist/cjs/utils/ipfs.d.ts +12 -0
- package/dist/cjs/utils/ipfs.d.ts.map +1 -0
- package/dist/cjs/utils/ipfs.js +26 -0
- package/dist/cjs/utils/ipfs.js.map +1 -0
- package/dist/cjs/utils/ipfs.test.d.ts +2 -0
- package/dist/cjs/utils/ipfs.test.d.ts.map +1 -0
- package/dist/cjs/utils/ipfs.test.js +28 -0
- package/dist/cjs/utils/ipfs.test.js.map +1 -0
- package/dist/cjs/utils/revnet.d.ts +5 -0
- package/dist/cjs/utils/revnet.d.ts.map +1 -0
- package/dist/cjs/utils/revnet.js +26 -0
- package/dist/cjs/utils/revnet.js.map +1 -0
- package/dist/cjs/utils/revnet.test.d.ts +2 -0
- package/dist/cjs/utils/revnet.test.d.ts.map +1 -0
- package/dist/cjs/utils/revnet.test.js +10 -0
- package/dist/cjs/utils/revnet.test.js.map +1 -0
- package/dist/cjs/utils/ruleset.d.ts +18 -0
- package/dist/cjs/utils/ruleset.d.ts.map +1 -0
- package/dist/cjs/utils/ruleset.js +23 -0
- package/dist/cjs/utils/ruleset.js.map +1 -0
- package/dist/cjs/utils/ruleset.test.d.ts +2 -0
- package/dist/cjs/utils/ruleset.test.d.ts.map +1 -0
- package/dist/cjs/utils/ruleset.test.js +21 -0
- package/dist/cjs/utils/ruleset.test.js.map +1 -0
- package/dist/cjs/utils/token.d.ts +72 -0
- package/dist/cjs/utils/token.d.ts.map +1 -0
- package/dist/cjs/utils/token.js +129 -0
- package/dist/cjs/utils/token.js.map +1 -0
- package/dist/cjs/utils/token.test.d.ts +2 -0
- package/dist/cjs/utils/token.test.d.ts.map +1 -0
- package/dist/cjs/utils/token.test.js +38 -0
- package/dist/cjs/utils/token.test.js.map +1 -0
- package/dist/cjs/utils/tx.d.ts +2 -0
- package/dist/cjs/utils/tx.d.ts.map +1 -0
- package/dist/cjs/utils/tx.js +7 -0
- package/dist/cjs/utils/tx.js.map +1 -0
- package/dist/cjs/utils/urn.d.ts +8 -0
- package/dist/cjs/utils/urn.d.ts.map +1 -0
- package/dist/cjs/utils/urn.js +47 -0
- package/dist/cjs/utils/urn.js.map +1 -0
- package/dist/cjs/utils/urn.test.d.ts +2 -0
- package/dist/cjs/utils/urn.test.d.ts.map +1 -0
- package/dist/cjs/utils/urn.test.js +112 -0
- package/dist/cjs/utils/urn.test.js.map +1 -0
- package/dist/esm/actions/JBSuckerAbi.d.ts +32 -0
- package/dist/esm/actions/JBSuckerAbi.d.ts.map +1 -0
- package/dist/esm/actions/JBSuckerAbi.js +42 -0
- package/dist/esm/actions/JBSuckerAbi.js.map +1 -0
- package/dist/esm/actions/dataHook.d.ts +29 -0
- package/dist/esm/actions/dataHook.d.ts.map +1 -0
- package/dist/esm/actions/dataHook.js +81 -0
- package/dist/esm/actions/dataHook.js.map +1 -0
- package/dist/esm/actions/projectMetadata.d.ts +16 -0
- package/dist/esm/actions/projectMetadata.d.ts.map +1 -0
- package/dist/esm/actions/projectMetadata.js +37 -0
- package/dist/esm/actions/projectMetadata.js.map +1 -0
- package/dist/esm/actions/suckerPairs.d.ts +19 -0
- package/dist/esm/actions/suckerPairs.d.ts.map +1 -0
- package/dist/esm/actions/suckerPairs.js +71 -0
- package/dist/esm/actions/suckerPairs.js.map +1 -0
- package/dist/esm/constants.d.ts +126 -0
- package/dist/esm/constants.d.ts.map +1 -0
- package/dist/esm/constants.js +229 -0
- package/dist/esm/constants.js.map +1 -0
- package/dist/esm/contracts.d.ts +71 -0
- package/dist/esm/contracts.d.ts.map +1 -0
- package/dist/esm/contracts.js +78 -0
- package/dist/esm/contracts.js.map +1 -0
- package/dist/esm/generated/juicebox.d.ts +79672 -0
- package/dist/esm/generated/juicebox.d.ts.map +1 -0
- package/dist/esm/generated/juicebox.js +62354 -0
- package/dist/esm/generated/juicebox.js.map +1 -0
- package/dist/esm/index.d.ts +9 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +9 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/types.d.ts +120 -0
- package/dist/esm/types.d.ts.map +1 -0
- package/dist/esm/types.js +31 -0
- package/dist/esm/types.js.map +1 -0
- package/dist/esm/utils/contracts.d.ts +10 -0
- package/dist/esm/utils/contracts.d.ts.map +1 -0
- package/dist/esm/utils/contracts.js +28 -0
- package/dist/esm/utils/contracts.js.map +1 -0
- package/dist/esm/utils/data.d.ts +69 -0
- package/dist/esm/utils/data.d.ts.map +1 -0
- package/dist/esm/utils/data.js +80 -0
- package/dist/esm/utils/data.js.map +1 -0
- package/dist/esm/utils/data.test.d.ts +2 -0
- package/dist/esm/utils/data.test.d.ts.map +1 -0
- package/dist/esm/utils/data.test.js +25 -0
- package/dist/esm/utils/data.test.js.map +1 -0
- package/dist/esm/utils/debug.d.ts +2 -0
- package/dist/esm/utils/debug.d.ts.map +1 -0
- package/dist/esm/utils/debug.js +11 -0
- package/dist/esm/utils/debug.js.map +1 -0
- package/dist/esm/utils/deploy.d.ts +32 -0
- package/dist/esm/utils/deploy.d.ts.map +1 -0
- package/dist/esm/utils/deploy.js +62 -0
- package/dist/esm/utils/deploy.js.map +1 -0
- package/dist/esm/utils/deploy.test.d.ts +2 -0
- package/dist/esm/utils/deploy.test.d.ts.map +1 -0
- package/dist/esm/utils/deploy.test.js +22 -0
- package/dist/esm/utils/deploy.test.js.map +1 -0
- package/dist/esm/utils/fee.d.ts +2 -0
- package/dist/esm/utils/fee.d.ts.map +1 -0
- package/dist/esm/utils/fee.js +5 -0
- package/dist/esm/utils/fee.js.map +1 -0
- package/dist/esm/utils/fee.test.d.ts +2 -0
- package/dist/esm/utils/fee.test.d.ts.map +1 -0
- package/dist/esm/utils/fee.test.js +9 -0
- package/dist/esm/utils/fee.test.js.map +1 -0
- package/dist/esm/utils/format.d.ts +33 -0
- package/dist/esm/utils/format.d.ts.map +1 -0
- package/dist/esm/utils/format.js +48 -0
- package/dist/esm/utils/format.js.map +1 -0
- package/dist/esm/utils/format.test.d.ts +2 -0
- package/dist/esm/utils/format.test.d.ts.map +1 -0
- package/dist/esm/utils/format.test.js +25 -0
- package/dist/esm/utils/format.test.js.map +1 -0
- package/dist/esm/utils/hook.d.ts +9 -0
- package/dist/esm/utils/hook.d.ts.map +1 -0
- package/dist/esm/utils/hook.js +44 -0
- package/dist/esm/utils/hook.js.map +1 -0
- package/dist/esm/utils/index.d.ts +13 -0
- package/dist/esm/utils/index.d.ts.map +1 -0
- package/dist/esm/utils/index.js +13 -0
- package/dist/esm/utils/index.js.map +1 -0
- package/dist/esm/utils/ipfs.d.ts +12 -0
- package/dist/esm/utils/ipfs.d.ts.map +1 -0
- package/dist/esm/utils/ipfs.js +26 -0
- package/dist/esm/utils/ipfs.js.map +1 -0
- package/dist/esm/utils/ipfs.test.d.ts +2 -0
- package/dist/esm/utils/ipfs.test.d.ts.map +1 -0
- package/dist/esm/utils/ipfs.test.js +28 -0
- package/dist/esm/utils/ipfs.test.js.map +1 -0
- package/dist/esm/utils/revnet.d.ts +5 -0
- package/dist/esm/utils/revnet.d.ts.map +1 -0
- package/dist/esm/utils/revnet.js +26 -0
- package/dist/esm/utils/revnet.js.map +1 -0
- package/dist/esm/utils/revnet.test.d.ts +2 -0
- package/dist/esm/utils/revnet.test.d.ts.map +1 -0
- package/dist/esm/utils/revnet.test.js +10 -0
- package/dist/esm/utils/revnet.test.js.map +1 -0
- package/dist/esm/utils/ruleset.d.ts +18 -0
- package/dist/esm/utils/ruleset.d.ts.map +1 -0
- package/dist/esm/utils/ruleset.js +23 -0
- package/dist/esm/utils/ruleset.js.map +1 -0
- package/dist/esm/utils/ruleset.test.d.ts +2 -0
- package/dist/esm/utils/ruleset.test.d.ts.map +1 -0
- package/dist/esm/utils/ruleset.test.js +21 -0
- package/dist/esm/utils/ruleset.test.js.map +1 -0
- package/dist/esm/utils/token.d.ts +72 -0
- package/dist/esm/utils/token.d.ts.map +1 -0
- package/dist/esm/utils/token.js +129 -0
- package/dist/esm/utils/token.js.map +1 -0
- package/dist/esm/utils/token.test.d.ts +2 -0
- package/dist/esm/utils/token.test.d.ts.map +1 -0
- package/dist/esm/utils/token.test.js +38 -0
- package/dist/esm/utils/token.test.js.map +1 -0
- package/dist/esm/utils/tx.d.ts +2 -0
- package/dist/esm/utils/tx.d.ts.map +1 -0
- package/dist/esm/utils/tx.js +7 -0
- package/dist/esm/utils/tx.js.map +1 -0
- package/dist/esm/utils/urn.d.ts +8 -0
- package/dist/esm/utils/urn.d.ts.map +1 -0
- package/dist/esm/utils/urn.js +47 -0
- package/dist/esm/utils/urn.js.map +1 -0
- package/dist/esm/utils/urn.test.d.ts +2 -0
- package/dist/esm/utils/urn.test.d.ts.map +1 -0
- package/dist/esm/utils/urn.test.js +112 -0
- package/dist/esm/utils/urn.test.js.map +1 -0
- package/dist/tsconfig.cjs.tsbuildinfo +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +65 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fee.test.js","sourceRoot":"","sources":["../../../src/utils/fee.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAEhD,QAAQ,CAAC,KAAK,EAAE,GAAG,EAAE;IACnB,IAAI,CAAC,sBAAsB,EAAE,GAAG,EAAE;QAChC,MAAM,CAAC,oBAAoB,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACvE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Format a given Ethereum address to a human-readable representation.
|
|
3
|
+
* @param address The address to format.
|
|
4
|
+
* @param opts.truncateTo The number of characters to include either side of the elipsis (...).
|
|
5
|
+
* @returns The formatted string e.g. 0x0000...0000
|
|
6
|
+
*/
|
|
7
|
+
export declare function formatEthAddress(address: string, { truncateTo, }?: {
|
|
8
|
+
truncateTo?: number;
|
|
9
|
+
}): string;
|
|
10
|
+
/**
|
|
11
|
+
* Converts numerical wei to a string representation of Ether.
|
|
12
|
+
* This function wraps viem's formatEther.
|
|
13
|
+
* @see https://viem.sh/docs/utilities/formatEther.html
|
|
14
|
+
* @param wei the Ether value in wei (fixed-point number with 18 decimals)
|
|
15
|
+
* @param opts.fractionDigits The number of
|
|
16
|
+
* @returns
|
|
17
|
+
*/
|
|
18
|
+
export declare function formatEther(wei: bigint, opts?: {
|
|
19
|
+
fractionDigits?: number;
|
|
20
|
+
}): string;
|
|
21
|
+
/**
|
|
22
|
+
* Divides a number by a given exponent of base 10 (10^exp), and formats it into a string representation of the number.
|
|
23
|
+
* This function wraps viem's formatUnits.
|
|
24
|
+
* @see https://viem.sh/docs/utilities/formatUnits.html
|
|
25
|
+
* @param value The value to format.
|
|
26
|
+
* @param units The units of the value.
|
|
27
|
+
* @param opts.fractionDigits The number of fraction digits (i.e. decimal places) to format to.
|
|
28
|
+
* @returns Formatted representation of [value].
|
|
29
|
+
*/
|
|
30
|
+
export declare function formatUnits(value: bigint, units: number, opts?: {
|
|
31
|
+
fractionDigits?: number;
|
|
32
|
+
}): string;
|
|
33
|
+
//# sourceMappingURL=format.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../src/utils/format.ts"],"names":[],"mappings":"AAOA;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,MAAM,EACf,EACE,UAAgC,GACjC,GAAE;IACD,UAAU,CAAC,EAAE,MAAM,CAAC;CAGrB,UAQF;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CACzB,GAAG,EAAE,MAAM,EACX,IAAI,CAAC,EAAE;IAAE,cAAc,CAAC,EAAE,MAAM,CAAA;CAAE,GACjC,MAAM,CASR;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,IAAI,CAAC,EAAE;IAAE,cAAc,CAAC,EAAE,MAAM,CAAA;CAAE,UAUnC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { formatEther as formatEtherViem, formatUnits as formatUnitsViem, } from "viem";
|
|
2
|
+
const DEFAULT_TRUNCATE_TO = 4;
|
|
3
|
+
/**
|
|
4
|
+
* Format a given Ethereum address to a human-readable representation.
|
|
5
|
+
* @param address The address to format.
|
|
6
|
+
* @param opts.truncateTo The number of characters to include either side of the elipsis (...).
|
|
7
|
+
* @returns The formatted string e.g. 0x0000...0000
|
|
8
|
+
*/
|
|
9
|
+
export function formatEthAddress(address, { truncateTo = DEFAULT_TRUNCATE_TO, } = {
|
|
10
|
+
truncateTo: DEFAULT_TRUNCATE_TO,
|
|
11
|
+
}) {
|
|
12
|
+
const frontTruncate = truncateTo + 2; // account for 0x
|
|
13
|
+
return (address.substring(0, frontTruncate) +
|
|
14
|
+
"..." +
|
|
15
|
+
address.substring(address.length - truncateTo, address.length));
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Converts numerical wei to a string representation of Ether.
|
|
19
|
+
* This function wraps viem's formatEther.
|
|
20
|
+
* @see https://viem.sh/docs/utilities/formatEther.html
|
|
21
|
+
* @param wei the Ether value in wei (fixed-point number with 18 decimals)
|
|
22
|
+
* @param opts.fractionDigits The number of
|
|
23
|
+
* @returns
|
|
24
|
+
*/
|
|
25
|
+
export function formatEther(wei, opts) {
|
|
26
|
+
const formatted = formatEtherViem(wei);
|
|
27
|
+
if (typeof opts?.fractionDigits === "undefined")
|
|
28
|
+
return formatted;
|
|
29
|
+
// parse float again to trim trailing 0s
|
|
30
|
+
return parseFloat(parseFloat(formatted).toFixed(opts?.fractionDigits)).toString();
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Divides a number by a given exponent of base 10 (10^exp), and formats it into a string representation of the number.
|
|
34
|
+
* This function wraps viem's formatUnits.
|
|
35
|
+
* @see https://viem.sh/docs/utilities/formatUnits.html
|
|
36
|
+
* @param value The value to format.
|
|
37
|
+
* @param units The units of the value.
|
|
38
|
+
* @param opts.fractionDigits The number of fraction digits (i.e. decimal places) to format to.
|
|
39
|
+
* @returns Formatted representation of [value].
|
|
40
|
+
*/
|
|
41
|
+
export function formatUnits(value, units, opts) {
|
|
42
|
+
const formatted = formatUnitsViem(value, units);
|
|
43
|
+
if (typeof opts?.fractionDigits === "undefined")
|
|
44
|
+
return formatted;
|
|
45
|
+
// parse float again to trim trailing 0s
|
|
46
|
+
return parseFloat(parseFloat(formatted).toFixed(opts?.fractionDigits)).toString();
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=format.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.js","sourceRoot":"","sources":["../../../src/utils/format.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,IAAI,eAAe,EAC9B,WAAW,IAAI,eAAe,GAC/B,MAAM,MAAM,CAAC;AAEd,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAE9B;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAC9B,OAAe,EACf,EACE,UAAU,GAAG,mBAAmB,MAG9B;IACF,UAAU,EAAE,mBAAmB;CAChC;IAED,MAAM,aAAa,GAAG,UAAU,GAAG,CAAC,CAAC,CAAC,iBAAiB;IACvD,OAAO,CACL,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,aAAa,CAAC;QACnC,KAAK;QACL,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,GAAG,UAAU,EAAE,OAAO,CAAC,MAAM,CAAC,CAC/D,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,WAAW,CACzB,GAAW,EACX,IAAkC;IAElC,MAAM,SAAS,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC;IAEvC,IAAI,OAAO,IAAI,EAAE,cAAc,KAAK,WAAW;QAAE,OAAO,SAAS,CAAC;IAElE,wCAAwC;IACxC,OAAO,UAAU,CACf,UAAU,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,cAAc,CAAC,CACpD,CAAC,QAAQ,EAAE,CAAC;AACf,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,WAAW,CACzB,KAAa,EACb,KAAa,EACb,IAAkC;IAElC,MAAM,SAAS,GAAG,eAAe,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAEhD,IAAI,OAAO,IAAI,EAAE,cAAc,KAAK,WAAW;QAAE,OAAO,SAAS,CAAC;IAElE,wCAAwC;IACxC,OAAO,UAAU,CACf,UAAU,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,cAAc,CAAC,CACpD,CAAC,QAAQ,EAAE,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.test.d.ts","sourceRoot":"","sources":["../../../src/utils/format.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { describe, expect, test } from "vitest";
|
|
2
|
+
import { formatEthAddress, formatEther, formatUnits } from "./format.js";
|
|
3
|
+
describe("formatting utilities", () => {
|
|
4
|
+
test("formats Ethereum address correctly", () => {
|
|
5
|
+
const address = "0x123456789abcdef0123456789abcdef012345678";
|
|
6
|
+
expect(formatEthAddress(address, { truncateTo: 4 })).toEqual("0x1234...5678");
|
|
7
|
+
});
|
|
8
|
+
test.each `
|
|
9
|
+
wei | fractionDigits | expected
|
|
10
|
+
${1000000000000000000n} | ${2} | ${"1"}
|
|
11
|
+
${1234567890123456789n} | ${3} | ${"1.235"}
|
|
12
|
+
${1234567890123456789n} | ${0} | ${"1"}
|
|
13
|
+
`("formats Ether correctly", ({ wei, fractionDigits, expected }) => {
|
|
14
|
+
expect(formatEther(wei, { fractionDigits })).toEqual(expected);
|
|
15
|
+
});
|
|
16
|
+
test.each `
|
|
17
|
+
value | units | fractionDigits | expected
|
|
18
|
+
${1000000000n} | ${9} | ${2} | ${"1"}
|
|
19
|
+
${1234567890n} | ${9} | ${3} | ${"1.235"}
|
|
20
|
+
${1234567890n} | ${9} | ${0} | ${"1"}
|
|
21
|
+
`("formats Units correctly", ({ value, units, fractionDigits, expected }) => {
|
|
22
|
+
expect(formatUnits(value, units, { fractionDigits })).toEqual(expected);
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
//# sourceMappingURL=format.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.test.js","sourceRoot":"","sources":["../../../src/utils/format.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAEzE,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;IACpC,IAAI,CAAC,oCAAoC,EAAE,GAAG,EAAE;QAC9C,MAAM,OAAO,GAAG,4CAA4C,CAAC;QAC7D,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAC1D,eAAe,CAChB,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,IAAI,CAAA;;MAEL,oBAAoB,MAAM,CAAC,gBAAgB,GAAG;MAC9C,oBAAoB,MAAM,CAAC,gBAAgB,OAAO;MAClD,oBAAoB,MAAM,CAAC,gBAAgB,GAAG;GACjD,CAAC,yBAAyB,EAAE,CAAC,EAAE,GAAG,EAAE,cAAc,EAAE,QAAQ,EAAE,EAAE,EAAE;QACjE,MAAM,CAAC,WAAW,CAAC,GAAG,EAAE,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACjE,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,IAAI,CAAA;;MAEL,WAAW,MAAM,CAAC,OAAO,CAAC,gBAAgB,GAAG;MAC7C,WAAW,MAAM,CAAC,OAAO,CAAC,gBAAgB,OAAO;MACjD,WAAW,MAAM,CAAC,OAAO,CAAC,gBAAgB,GAAG;GAChD,CAAC,yBAAyB,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,EAAE,EAAE;QAC1E,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC1E,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Create metadata for pay or redeem hooks.
|
|
4
|
+
*
|
|
5
|
+
* @link https://github.com/simplemachine92/JBMetadata-Helper
|
|
6
|
+
* @attribution simplemachine92/nowonder
|
|
7
|
+
*/
|
|
8
|
+
export declare function createHookMetadata(ids: string[], metadatas: string[]): `0x${string}`;
|
|
9
|
+
//# sourceMappingURL=hook.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hook.d.ts","sourceRoot":"","sources":["../../../src/utils/hook.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,iBA8CpE"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { encodePacked, zeroHash } from "viem";
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* Create metadata for pay or redeem hooks.
|
|
5
|
+
*
|
|
6
|
+
* @link https://github.com/simplemachine92/JBMetadata-Helper
|
|
7
|
+
* @attribution simplemachine92/nowonder
|
|
8
|
+
*/
|
|
9
|
+
export function createHookMetadata(ids, metadatas) {
|
|
10
|
+
// Check lengths
|
|
11
|
+
if (ids.length !== metadatas.length)
|
|
12
|
+
throw new Error("LENGTH_MISMATCH");
|
|
13
|
+
// Initialize metadata with first 32B for the protocol reserved word
|
|
14
|
+
let metadata = encodePacked(["bytes32"], [zeroHash]);
|
|
15
|
+
// Calculate offset for the data is after the first reserved word...
|
|
16
|
+
let offset = 1;
|
|
17
|
+
// ... and after the id/offset lookup table, rounding up to 32 bytes if not a multiple
|
|
18
|
+
offset += Math.floor(ids.length);
|
|
19
|
+
// For each id, add it to the lookup table with the next free offset, then increment the offset by the data length
|
|
20
|
+
for (let i = 0; i < ids.length; i++) {
|
|
21
|
+
// Get metadata, id and offset
|
|
22
|
+
metadata += encodePacked(["bytes4"], [ids[i]]).slice(2);
|
|
23
|
+
metadata += encodePacked(["uint8"], [offset]).slice(2);
|
|
24
|
+
// increment the offset by the data length, rounded up to the nearest 32-byte word
|
|
25
|
+
offset += metadatas[i].length / 32;
|
|
26
|
+
// Overflowing a bytes1?
|
|
27
|
+
if (offset > 2 ** 8)
|
|
28
|
+
throw new Error("METADATA_TOO_LONG");
|
|
29
|
+
}
|
|
30
|
+
// Pad the table to a multiple of 32B
|
|
31
|
+
let paddedLength = metadata.length % 32 === 0
|
|
32
|
+
? metadata.length
|
|
33
|
+
: Math.ceil(metadata.length / 32 + 1) * 32;
|
|
34
|
+
// Update metadata length
|
|
35
|
+
metadata = metadata.padEnd(paddedLength + 2, "0");
|
|
36
|
+
// Add each metadata to the array, each padded to 32 bytes
|
|
37
|
+
for (let i = 0; i < metadatas.length; i++) {
|
|
38
|
+
// Append metadata to array
|
|
39
|
+
metadata += encodePacked(["bytes"], [metadatas[i].padEnd(paddedLength, "0")]).slice(2);
|
|
40
|
+
}
|
|
41
|
+
// Return complete metadata
|
|
42
|
+
return metadata;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=hook.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hook.js","sourceRoot":"","sources":["../../../src/utils/hook.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,YAAY,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAEpD;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAAC,GAAa,EAAE,SAAmB;IACnE,gBAAgB;IAChB,IAAI,GAAG,CAAC,MAAM,KAAK,SAAS,CAAC,MAAM;QAAE,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAExE,oEAAoE;IACpE,IAAI,QAAQ,GAAG,YAAY,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAErD,oEAAoE;IACpE,IAAI,MAAM,GAAG,CAAC,CAAC;IAEf,sFAAsF;IACtF,MAAM,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAEjC,kHAAkH;IAClH,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACpC,8BAA8B;QAC9B,QAAQ,IAAI,YAAY,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAEhE,QAAQ,IAAI,YAAY,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACvD,kFAAkF;QAClF,MAAM,IAAI,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,EAAE,CAAC;QAEnC,wBAAwB;QACxB,IAAI,MAAM,GAAG,CAAC,IAAI,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;IAC5D,CAAC;IAED,qCAAqC;IACrC,IAAI,YAAY,GACd,QAAQ,CAAC,MAAM,GAAG,EAAE,KAAK,CAAC;QACxB,CAAC,CAAC,QAAQ,CAAC,MAAM;QACjB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,EAAE,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;IAE/C,yBAAyB;IACzB,QAAQ,GAAG,QAAQ,CAAC,MAAM,CAAC,YAAY,GAAG,CAAC,EAAE,GAAG,CAAS,CAAC;IAE1D,0DAA0D;IAC1D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAC1C,2BAA2B;QAC3B,QAAQ,IAAI,YAAY,CACtB,CAAC,OAAO,CAAC,EACT,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,YAAY,EAAE,GAAG,CAAS,CAAC,CACjD,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACb,CAAC;IAED,2BAA2B;IAC3B,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from "./contracts.js";
|
|
2
|
+
export * from "./data.js";
|
|
3
|
+
export * from "./debug.js";
|
|
4
|
+
export * from "./deploy.js";
|
|
5
|
+
export * from "./fee.js";
|
|
6
|
+
export * from "./format.js";
|
|
7
|
+
export * from "./hook.js";
|
|
8
|
+
export * from "./revnet.js";
|
|
9
|
+
export * from "./ruleset.js";
|
|
10
|
+
export * from "./token.js";
|
|
11
|
+
export * from "./tx.js";
|
|
12
|
+
export * from "./urn.js";
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from "./contracts.js";
|
|
2
|
+
export * from "./data.js";
|
|
3
|
+
export * from "./debug.js";
|
|
4
|
+
export * from "./deploy.js";
|
|
5
|
+
export * from "./fee.js";
|
|
6
|
+
export * from "./format.js";
|
|
7
|
+
export * from "./hook.js";
|
|
8
|
+
export * from "./revnet.js";
|
|
9
|
+
export * from "./ruleset.js";
|
|
10
|
+
export * from "./token.js";
|
|
11
|
+
export * from "./tx.js";
|
|
12
|
+
export * from "./urn.js";
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare function ipfsGatewayUrl(cid: string | undefined, gatewayHostname?: string): string;
|
|
2
|
+
/**
|
|
3
|
+
* Return a hex-encoded CID to store on-chain.
|
|
4
|
+
* Hex-encoded CIDs are used to store some CIDs on-chain because they are more gas-efficient.
|
|
5
|
+
*/
|
|
6
|
+
export declare function encodeIpfsUri(cid: string): string;
|
|
7
|
+
/**
|
|
8
|
+
* Return the IPFS CID from a given hex-endoded string.
|
|
9
|
+
* Hex-encoded CIDs are used to store some CIDs on-chain because they are more gas-efficient.
|
|
10
|
+
*/
|
|
11
|
+
export declare function decodeEncodedIpfsUri(hex: string): string;
|
|
12
|
+
//# sourceMappingURL=ipfs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ipfs.d.ts","sourceRoot":"","sources":["../../../src/utils/ipfs.ts"],"names":[],"mappings":"AAIA,wBAAgB,cAAc,CAC5B,GAAG,EAAE,MAAM,GAAG,SAAS,EACvB,eAAe,CAAC,EAAE,MAAM,GACvB,MAAM,CAIR;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,UAExC;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,UAQ/C"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import bs58 from "bs58";
|
|
2
|
+
const PUBLIC_IPFS_GATEWAY_HOSTNAME = "ipfs.io";
|
|
3
|
+
export function ipfsGatewayUrl(cid, gatewayHostname) {
|
|
4
|
+
return `https://${gatewayHostname ?? PUBLIC_IPFS_GATEWAY_HOSTNAME}/ipfs/${cid}`;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Return a hex-encoded CID to store on-chain.
|
|
8
|
+
* Hex-encoded CIDs are used to store some CIDs on-chain because they are more gas-efficient.
|
|
9
|
+
*/
|
|
10
|
+
export function encodeIpfsUri(cid) {
|
|
11
|
+
return "0x" + Buffer.from(bs58.decode(cid).slice(2)).toString("hex");
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Return the IPFS CID from a given hex-endoded string.
|
|
15
|
+
* Hex-encoded CIDs are used to store some CIDs on-chain because they are more gas-efficient.
|
|
16
|
+
*/
|
|
17
|
+
export function decodeEncodedIpfsUri(hex) {
|
|
18
|
+
// Add default ipfs values for first 2 bytes:
|
|
19
|
+
// - function:0x12=sha2, size:0x20=256 bits
|
|
20
|
+
// - also cut off leading "0x"
|
|
21
|
+
const hashHex = "1220" + hex.slice(2);
|
|
22
|
+
const hashBytes = Buffer.from(hashHex, "hex");
|
|
23
|
+
const hashStr = bs58.encode(hashBytes);
|
|
24
|
+
return hashStr;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=ipfs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ipfs.js","sourceRoot":"","sources":["../../../src/utils/ipfs.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,MAAM,4BAA4B,GAAG,SAAS,CAAC;AAE/C,MAAM,UAAU,cAAc,CAC5B,GAAuB,EACvB,eAAwB;IAExB,OAAO,WACL,eAAe,IAAI,4BACrB,SAAS,GAAG,EAAE,CAAC;AACjB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,GAAW;IACvC,OAAO,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACvE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAC,GAAW;IAC9C,6CAA6C;IAC7C,2CAA2C;IAC3C,8BAA8B;IAC9B,MAAM,OAAO,GAAG,MAAM,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACtC,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAC9C,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACvC,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ipfs.test.d.ts","sourceRoot":"","sources":["../../../src/utils/ipfs.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import bs58 from "bs58";
|
|
2
|
+
import { describe, expect, test } from "vitest";
|
|
3
|
+
import { decodeEncodedIpfsUri, encodeIpfsUri, ipfsGatewayUrl } from "./ipfs.js";
|
|
4
|
+
const cid = "QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR";
|
|
5
|
+
const cidCorrespondingHex = "c3c4733ec8affd06cf9e9ff50ffc6bcd2ec85a6170004bb709669c31de94391a";
|
|
6
|
+
describe("IPFS utilities", () => {
|
|
7
|
+
test("generates IPFS gateway URL correctly", () => {
|
|
8
|
+
expect(ipfsGatewayUrl(cid)).toEqual(`https://ipfs.io/ipfs/${cid}`);
|
|
9
|
+
expect(ipfsGatewayUrl(cid, "another-gateway.com")).toEqual(`https://another-gateway.com/ipfs/${cid}`);
|
|
10
|
+
expect(ipfsGatewayUrl(undefined)).toEqual("https://ipfs.io/ipfs/undefined");
|
|
11
|
+
});
|
|
12
|
+
test("encodes IPFS CID correctly", () => {
|
|
13
|
+
const hexEncoded = encodeIpfsUri(cid);
|
|
14
|
+
expect(hexEncoded).toEqual("0x" + cidCorrespondingHex);
|
|
15
|
+
});
|
|
16
|
+
test("decodes hex-encoded IPFS CID correctly", () => {
|
|
17
|
+
const hexEncoded = "0x" + cidCorrespondingHex;
|
|
18
|
+
const decodedCid = decodeEncodedIpfsUri(hexEncoded);
|
|
19
|
+
expect(decodedCid).toEqual(cid);
|
|
20
|
+
});
|
|
21
|
+
test("encodes and then decodes IPFS CID correctly", () => {
|
|
22
|
+
const expectedHex = Buffer.from(bs58.decode(cid).slice(2)).toString("hex");
|
|
23
|
+
const hexEncoded = "0x" + expectedHex;
|
|
24
|
+
const decodedCid = decodeEncodedIpfsUri(hexEncoded);
|
|
25
|
+
expect(decodedCid).toEqual(cid);
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
//# sourceMappingURL=ipfs.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ipfs.test.js","sourceRoot":"","sources":["../../../src/utils/ipfs.test.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAEhF,MAAM,GAAG,GAAG,gDAAgD,CAAC;AAC7D,MAAM,mBAAmB,GACvB,kEAAkE,CAAC;AAErE,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,IAAI,CAAC,sCAAsC,EAAE,GAAG,EAAE;QAChD,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,wBAAwB,GAAG,EAAE,CAAC,CAAC;QACnE,MAAM,CAAC,cAAc,CAAC,GAAG,EAAE,qBAAqB,CAAC,CAAC,CAAC,OAAO,CACxD,oCAAoC,GAAG,EAAE,CAC1C,CAAC;QACF,MAAM,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,gCAAgC,CAAC,CAAC;IAC9E,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,4BAA4B,EAAE,GAAG,EAAE;QACtC,MAAM,UAAU,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC;QACtC,MAAM,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,IAAI,GAAG,mBAAmB,CAAC,CAAC;IACzD,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,wCAAwC,EAAE,GAAG,EAAE;QAClD,MAAM,UAAU,GAAG,IAAI,GAAG,mBAAmB,CAAC;QAC9C,MAAM,UAAU,GAAG,oBAAoB,CAAC,UAAU,CAAC,CAAC;QACpD,MAAM,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,6CAA6C,EAAE,GAAG,EAAE;QACvD,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC3E,MAAM,UAAU,GAAG,IAAI,GAAG,WAAW,CAAC;QACtC,MAAM,UAAU,GAAG,oBAAoB,CAAC,UAAU,CAAC,CAAC;QACpD,MAAM,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { JBChainId } from "src/types.js";
|
|
2
|
+
import { JBVersion } from "../contracts.js";
|
|
3
|
+
export declare function calcPrepaidFee(monthsToPrePay: number): bigint;
|
|
4
|
+
export declare function getRevnetLoanContract(version: JBVersion, chainId: JBChainId): "0xde1e70faf22024559e7d94ab814abd7e42ca849b" | "0x1880d832aa283d05b8eab68877717e25fbd550bb" | "0x056265c31157748818f0910d1859acd2f7d427de";
|
|
5
|
+
//# sourceMappingURL=revnet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"revnet.d.ts","sourceRoot":"","sources":["../../../src/utils/revnet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAY5C,wBAAgB,cAAc,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,CAY7D;AAED,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,8IAI3E"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jbContractAddress } from "../generated/juicebox.js";
|
|
2
|
+
// The maximum fee percent
|
|
3
|
+
const MAX_PREPAID_FEE_PERCENT_BIGINT = 500n;
|
|
4
|
+
// Minimum prepaid fee value allowed by the contract
|
|
5
|
+
const MIN_PREPAID_FEE = 25n;
|
|
6
|
+
// The divisor (max months) as a BigInt for the calculation.
|
|
7
|
+
const MAX_PREPAYMENT_MONTHS_BIGINT = 120n;
|
|
8
|
+
export function calcPrepaidFee(monthsToPrePay) {
|
|
9
|
+
const calcd = (BigInt(monthsToPrePay) * MAX_PREPAID_FEE_PERCENT_BIGINT) / MAX_PREPAYMENT_MONTHS_BIGINT +
|
|
10
|
+
MIN_PREPAID_FEE;
|
|
11
|
+
if (calcd < MIN_PREPAID_FEE) {
|
|
12
|
+
return MIN_PREPAID_FEE;
|
|
13
|
+
}
|
|
14
|
+
else if (calcd > MAX_PREPAID_FEE_PERCENT_BIGINT) {
|
|
15
|
+
return MAX_PREPAID_FEE_PERCENT_BIGINT;
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
return calcd;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
export function getRevnetLoanContract(version, chainId) {
|
|
22
|
+
return version === 4
|
|
23
|
+
? jbContractAddress[4]["REVLoans1_1"][chainId]
|
|
24
|
+
: jbContractAddress[version]["REVLoans"][chainId];
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=revnet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"revnet.js","sourceRoot":"","sources":["../../../src/utils/revnet.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,0BAA0B;AAC1B,MAAM,8BAA8B,GAAG,IAAI,CAAC;AAE5C,oDAAoD;AACpD,MAAM,eAAe,GAAG,GAAG,CAAC;AAE5B,4DAA4D;AAC5D,MAAM,4BAA4B,GAAG,IAAI,CAAC;AAE1C,MAAM,UAAU,cAAc,CAAC,cAAsB;IACnD,MAAM,KAAK,GACT,CAAC,MAAM,CAAC,cAAc,CAAC,GAAG,8BAA8B,CAAC,GAAG,4BAA4B;QACxF,eAAe,CAAC;IAElB,IAAI,KAAK,GAAG,eAAe,EAAE,CAAC;QAC5B,OAAO,eAAe,CAAC;IACzB,CAAC;SAAM,IAAI,KAAK,GAAG,8BAA8B,EAAE,CAAC;QAClD,OAAO,8BAA8B,CAAC;IACxC,CAAC;SAAM,CAAC;QACN,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,OAAkB,EAAE,OAAkB;IAC1E,OAAO,OAAO,KAAK,CAAC;QAClB,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC;QAC9C,CAAC,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,CAAC;AACtD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"revnet.test.d.ts","sourceRoot":"","sources":["../../../src/utils/revnet.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { describe, expect, test } from "vitest";
|
|
2
|
+
import { calcPrepaidFee } from "./revnet.js";
|
|
3
|
+
describe("calcPrepaidFee", () => {
|
|
4
|
+
test("calcPrepaidFee", () => {
|
|
5
|
+
expect(calcPrepaidFee(1)).toEqual(29n);
|
|
6
|
+
expect(calcPrepaidFee(0)).toEqual(25n);
|
|
7
|
+
expect(calcPrepaidFee(121)).toEqual(500n);
|
|
8
|
+
});
|
|
9
|
+
});
|
|
10
|
+
//# sourceMappingURL=revnet.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"revnet.test.js","sourceRoot":"","sources":["../../../src/utils/revnet.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,IAAI,CAAC,gBAAgB,EAAE,GAAG,EAAE;QAC1B,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACvC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACvC,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Derive the next ruleset's Weight value from the current ruleset.
|
|
3
|
+
*
|
|
4
|
+
* Useful when projecting a project's future Token B price.
|
|
5
|
+
* E.g. "In the next ruleset, how much will Token B cost, given the new Weight?"
|
|
6
|
+
*/
|
|
7
|
+
export declare function getNextRulesetWeight(currentRuleset: {
|
|
8
|
+
weight: bigint;
|
|
9
|
+
weightCutPercent: number;
|
|
10
|
+
}): bigint;
|
|
11
|
+
/**
|
|
12
|
+
* Derive the previous ruleset's Weight value from the current ruleset.
|
|
13
|
+
*/
|
|
14
|
+
export declare function getPrevRulesetWeight(currentRuleset: {
|
|
15
|
+
weight: bigint;
|
|
16
|
+
weightCutPercent: number;
|
|
17
|
+
}): bigint;
|
|
18
|
+
//# sourceMappingURL=ruleset.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ruleset.d.ts","sourceRoot":"","sources":["../../../src/utils/ruleset.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,cAAc,EAAE;IACnD,MAAM,EAAE,MAAM,CAAC;IACf,gBAAgB,EAAE,MAAM,CAAC;CAC1B,UAOA;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,cAAc,EAAE;IACnD,MAAM,EAAE,MAAM,CAAC;IACf,gBAAgB,EAAE,MAAM,CAAC;CAC1B,UAOA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { MAX_WEIGHT_CUT_PERCENT } from "../constants.js";
|
|
2
|
+
/**
|
|
3
|
+
* Derive the next ruleset's Weight value from the current ruleset.
|
|
4
|
+
*
|
|
5
|
+
* Useful when projecting a project's future Token B price.
|
|
6
|
+
* E.g. "In the next ruleset, how much will Token B cost, given the new Weight?"
|
|
7
|
+
*/
|
|
8
|
+
export function getNextRulesetWeight(currentRuleset) {
|
|
9
|
+
const nextRulesetWeight = (currentRuleset.weight *
|
|
10
|
+
BigInt(MAX_WEIGHT_CUT_PERCENT - currentRuleset.weightCutPercent)) /
|
|
11
|
+
BigInt(MAX_WEIGHT_CUT_PERCENT);
|
|
12
|
+
return nextRulesetWeight;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Derive the previous ruleset's Weight value from the current ruleset.
|
|
16
|
+
*/
|
|
17
|
+
export function getPrevRulesetWeight(currentRuleset) {
|
|
18
|
+
// reverse of getNextRulesetWeight
|
|
19
|
+
const prevRulesetWeight = (currentRuleset.weight * BigInt(MAX_WEIGHT_CUT_PERCENT)) /
|
|
20
|
+
BigInt(MAX_WEIGHT_CUT_PERCENT - currentRuleset.weightCutPercent);
|
|
21
|
+
return prevRulesetWeight;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=ruleset.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ruleset.js","sourceRoot":"","sources":["../../../src/utils/ruleset.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAEzD;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAAC,cAGpC;IACC,MAAM,iBAAiB,GACrB,CAAC,cAAc,CAAC,MAAM;QACpB,MAAM,CAAC,sBAAsB,GAAG,cAAc,CAAC,gBAAgB,CAAC,CAAC;QACnE,MAAM,CAAC,sBAAsB,CAAC,CAAC;IAEjC,OAAO,iBAAiB,CAAC;AAC3B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,cAGpC;IACC,kCAAkC;IAClC,MAAM,iBAAiB,GACrB,CAAC,cAAc,CAAC,MAAM,GAAG,MAAM,CAAC,sBAAsB,CAAC,CAAC;QACxD,MAAM,CAAC,sBAAsB,GAAG,cAAc,CAAC,gBAAgB,CAAC,CAAC;IAEnE,OAAO,iBAAiB,CAAC;AAC3B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ruleset.test.d.ts","sourceRoot":"","sources":["../../../src/utils/ruleset.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { describe, expect, test } from "vitest";
|
|
2
|
+
import { getNextRulesetWeight, getPrevRulesetWeight } from "./ruleset.js";
|
|
3
|
+
describe("Ruleset Weight utilities", () => {
|
|
4
|
+
test.each `
|
|
5
|
+
weight | weightCutPercent | expected
|
|
6
|
+
${100n} | ${200000000} | ${80n}
|
|
7
|
+
${200n} | ${300000000} | ${140n}
|
|
8
|
+
${300n} | ${0} | ${300n}
|
|
9
|
+
`("computes next ruleset weight correctly", ({ weight, weightCutPercent, expected }) => {
|
|
10
|
+
expect(getNextRulesetWeight({ weight, weightCutPercent })).toEqual(expected);
|
|
11
|
+
});
|
|
12
|
+
test.each `
|
|
13
|
+
weight | weightCutPercent | expected
|
|
14
|
+
${80n} | ${200000000} | ${100n}
|
|
15
|
+
${160n} | ${300000000} | ${228n}
|
|
16
|
+
${300n} | ${0} | ${300n}
|
|
17
|
+
`("computes previous cycle weight correctly", ({ weight, weightCutPercent, expected }) => {
|
|
18
|
+
expect(getPrevRulesetWeight({ weight, weightCutPercent })).toEqual(expected);
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
//# sourceMappingURL=ruleset.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ruleset.test.js","sourceRoot":"","sources":["../../../src/utils/ruleset.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAE1E,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACxC,IAAI,CAAC,IAAI,CAAA;;MAEL,IAAI,MAAM,SAAS,UAAU,GAAG;MAChC,IAAI,MAAM,SAAS,UAAU,IAAI;MACjC,IAAI,MAAM,CAAC,iBAAiB,IAAI;GACnC,CACC,wCAAwC,EACxC,CAAC,EAAE,MAAM,EAAE,gBAAgB,EAAE,QAAQ,EAAE,EAAE,EAAE;QACzC,MAAM,CAAC,oBAAoB,CAAC,EAAE,MAAM,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC,OAAO,CAChE,QAAQ,CACT,CAAC;IACJ,CAAC,CACF,CAAC;IAEF,IAAI,CAAC,IAAI,CAAA;;MAEL,GAAG,OAAO,SAAS,UAAU,IAAI;MACjC,IAAI,MAAM,SAAS,UAAU,IAAI;MACjC,IAAI,MAAM,CAAC,iBAAiB,IAAI;GACnC,CACC,0CAA0C,EAC1C,CAAC,EAAE,MAAM,EAAE,gBAAgB,EAAE,QAAQ,EAAE,EAAE,EAAE;QACzC,MAAM,CAAC,oBAAoB,CAAC,EAAE,MAAM,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC,OAAO,CAChE,QAAQ,CACT,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { FixedInt } from "fpnum";
|
|
2
|
+
import { ReservedPercent, RulesetWeight } from "./data.js";
|
|
3
|
+
/**
|
|
4
|
+
* Return a quote for how much Token B to mint for a given `tokenAAmount`.
|
|
5
|
+
*
|
|
6
|
+
* Useful for when users specify how much they want to spend (Token A).
|
|
7
|
+
*
|
|
8
|
+
* Accounts for the ruleset's `weight` and `reservedPercent`.
|
|
9
|
+
*
|
|
10
|
+
* Returned quote contains:
|
|
11
|
+
* - total tokens to be minted (JB ruleset `weight`).
|
|
12
|
+
* - tokens reserved for project.
|
|
13
|
+
* - tokens minted for the payer.
|
|
14
|
+
*/
|
|
15
|
+
export declare const getTokenAToBQuote: <D extends number>(tokenAAmount: FixedInt<D>, // wei
|
|
16
|
+
cycleParams: {
|
|
17
|
+
weight: RulesetWeight;
|
|
18
|
+
reservedPercent: ReservedPercent;
|
|
19
|
+
}) => {
|
|
20
|
+
tokenAAmount: FixedInt<D>;
|
|
21
|
+
payerTokens: bigint;
|
|
22
|
+
reservedTokens: bigint;
|
|
23
|
+
totalTokens: bigint;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Return the amount of Token A it costs to buy 1 Token B.
|
|
27
|
+
*
|
|
28
|
+
* Accounts for the ruleset's `weight` and `reservedPercent`.
|
|
29
|
+
*/
|
|
30
|
+
export declare const getTokenBPrice: (tokenADecimals: number, cycleParams: {
|
|
31
|
+
weight: RulesetWeight;
|
|
32
|
+
reservedPercent: ReservedPercent;
|
|
33
|
+
}) => FixedInt<number>;
|
|
34
|
+
/**
|
|
35
|
+
* Return the amount of Token A it costs to mint a given `tokenBAmount`.
|
|
36
|
+
*
|
|
37
|
+
* Accounts for the ruleset's `weight` and `reservedPercent`.
|
|
38
|
+
*
|
|
39
|
+
* Useful for when users specify the outcome they want (how much Token B they want).
|
|
40
|
+
*/
|
|
41
|
+
export declare const getTokenBtoAQuote: <D extends number>(tokenBAmount: FixedInt<D>, // wei
|
|
42
|
+
tokenADecimals: number, cycleParams: {
|
|
43
|
+
weight: RulesetWeight;
|
|
44
|
+
reservedPercent: ReservedPercent;
|
|
45
|
+
}) => FixedInt<number>;
|
|
46
|
+
/**
|
|
47
|
+
* Returns the ETH value (in wei) that a given [tokensAmount] can be redeemed for.
|
|
48
|
+
*
|
|
49
|
+
* @note Implements the formula:
|
|
50
|
+
* ```
|
|
51
|
+
* y = ox/s * ( (1 - r) + (x * r /s) )
|
|
52
|
+
* ```
|
|
53
|
+
*
|
|
54
|
+
* Where:
|
|
55
|
+
* - `y` = redeemable amount
|
|
56
|
+
* - `o` = overflow (primaryTerminalCurrentOverflow)
|
|
57
|
+
* - `x` = tokenAmount
|
|
58
|
+
* - `s` = total supply of token (realTotalTokenSupply)
|
|
59
|
+
* - `r` = cashOutTaxRate
|
|
60
|
+
*
|
|
61
|
+
* @implements JBCashOuts.cashOutFrom
|
|
62
|
+
* @see https://github.com/Bananapus/nana-core/blob/44ae030f910e4a40a9a70a1eccf67cb0cf0c80f9/src/libraries/JBCashOuts.sol
|
|
63
|
+
* @see https://www.desmos.com/calculator/sp9ru6zbpk
|
|
64
|
+
* @returns amount in ETH
|
|
65
|
+
*/
|
|
66
|
+
export declare const getTokenCashOutQuoteEth: (tokensAmount: bigint, { overflowWei, totalSupply, cashOutTaxRate, tokensReserved, }: {
|
|
67
|
+
overflowWei: bigint;
|
|
68
|
+
totalSupply: bigint;
|
|
69
|
+
cashOutTaxRate: number;
|
|
70
|
+
tokensReserved: bigint;
|
|
71
|
+
}) => bigint | 0;
|
|
72
|
+
//# sourceMappingURL=token.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token.d.ts","sourceRoot":"","sources":["../../../src/utils/token.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAO3D;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,iBAAiB,GAAI,CAAC,SAAS,MAAM,EAChD,cAAc,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM;AACjC,aAAa;IAAE,MAAM,EAAE,aAAa,CAAC;IAAC,eAAe,EAAE,eAAe,CAAA;CAAE;;;;;CAoBzE,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,cAAc,GACzB,gBAAgB,MAAM,EACtB,aAAa;IAAE,MAAM,EAAE,aAAa,CAAC;IAAC,eAAe,EAAE,eAAe,CAAA;CAAE,qBAYzE,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,GAAI,CAAC,SAAS,MAAM,EAChD,cAAc,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM;AACjC,gBAAgB,MAAM,EACtB,aAAa;IAAE,MAAM,EAAE,aAAa,CAAC;IAAC,eAAe,EAAE,eAAe,CAAA;CAAE,qBAOzE,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,uBAAuB,GAClC,cAAc,MAAM,EACpB,+DAKG;IACD,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;CACxB,eAwDF,CAAC"}
|