@flaunch/sdk 0.8.2 → 0.8.3-beta.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/abi/FlaunchZap.d.ts +106 -102
- package/dist/abi/FlaunchZap.d.ts.map +1 -1
- package/dist/abi/TreasuryManager.d.ts +106 -0
- package/dist/abi/TreasuryManager.d.ts.map +1 -0
- package/dist/abi/TreasuryManagerFactory.d.ts +268 -242
- package/dist/abi/TreasuryManagerFactory.d.ts.map +1 -1
- package/dist/abi/index.cjs +476 -322
- package/dist/abi/index.cjs.map +1 -1
- package/dist/abi/index.js +476 -322
- package/dist/abi/index.js.map +1 -1
- package/dist/addresses/index.cjs +23 -6
- package/dist/addresses/index.cjs.map +1 -1
- package/dist/addresses/index.js +21 -7
- package/dist/addresses/index.js.map +1 -1
- package/dist/addresses.d.ts +6 -1
- package/dist/addresses.d.ts.map +1 -1
- package/dist/clients/FlaunchZapClient.d.ts +8 -1
- package/dist/clients/FlaunchZapClient.d.ts.map +1 -1
- package/dist/clients/TreasuryManagerClient.d.ts +60 -0
- package/dist/clients/TreasuryManagerClient.d.ts.map +1 -0
- package/dist/clients/TreasuryManagerFactoryClient.d.ts +34 -7
- package/dist/clients/TreasuryManagerFactoryClient.d.ts.map +1 -1
- package/dist/helpers/index.cjs +61 -0
- package/dist/helpers/index.cjs.map +1 -1
- package/dist/helpers/index.d.ts +1 -0
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/helpers/index.js +62 -2
- package/dist/helpers/index.js.map +1 -1
- package/dist/helpers/permissions.d.ts +10 -0
- package/dist/helpers/permissions.d.ts.map +1 -0
- package/dist/index.cjs.js +935 -381
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +933 -383
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/sdk/FlaunchSDK.d.ts +71 -6
- package/dist/sdk/FlaunchSDK.d.ts.map +1 -1
- package/dist/types.d.ts +8 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/addresses.d.ts
CHANGED
|
@@ -10,6 +10,10 @@ export declare const VirtualsVerifierAddress: Addresses;
|
|
|
10
10
|
export declare const WhitelistVerifierAddress: Addresses;
|
|
11
11
|
export declare const ZoraVerifierAddress: Addresses;
|
|
12
12
|
/** ======== */
|
|
13
|
+
/** Permissions */
|
|
14
|
+
export declare const ClosedPermissionsAddress: Addresses;
|
|
15
|
+
export declare const WhitelistedPermissionsAddress: Addresses;
|
|
16
|
+
/** =========== */
|
|
13
17
|
export declare const FeeEscrowAddress: Addresses;
|
|
14
18
|
export declare const ReferralEscrowAddress: Addresses;
|
|
15
19
|
export declare const FLETHAddress: Addresses;
|
|
@@ -24,9 +28,10 @@ export declare const BidWallV1_1Address: Addresses;
|
|
|
24
28
|
export declare const AnyBidWallAddress: Addresses;
|
|
25
29
|
export declare const FastFlaunchZapAddress: Addresses;
|
|
26
30
|
export declare const FlaunchZapAddress: Addresses;
|
|
31
|
+
export declare const TreasuryManagerFactoryAddress: Addresses;
|
|
27
32
|
export declare const RevenueManagerAddress: Addresses;
|
|
28
33
|
export declare const AddressFeeSplitManagerAddress: Addresses;
|
|
29
|
-
export declare const
|
|
34
|
+
export declare const StakingManagerAddress: Addresses;
|
|
30
35
|
export declare const PoolManagerAddress: Addresses;
|
|
31
36
|
export declare const UniversalRouterAddress: Addresses;
|
|
32
37
|
export declare const QuoterAddress: Addresses;
|
package/dist/addresses.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addresses.d.ts","sourceRoot":"","sources":["../src/addresses.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAI7C,eAAO,MAAM,6BAA6B,EAAE,SAG3C,CAAC;AAEF,eAAO,MAAM,iCAAiC,EAAE,SAG/C,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE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SAGnC,CAAC;AAEF,eAAO,MAAM,6BAA6B,EAAE,SAG3C,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,SAGnC,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,SAGhC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,SAGpC,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,SAG3B,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,SAG9B,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,SAG5B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE;IAC5B,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;CAgB5B,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ReadContract, type Address, type Drift, type ReadWriteContract, type ReadWriteAdapter, type HexString } from "@delvtech/drift";
|
|
2
2
|
import { FlaunchZapAbi } from "../abi/FlaunchZap";
|
|
3
|
-
import { IPFSParams } from "../types";
|
|
3
|
+
import { IPFSParams, Permissions } from "../types";
|
|
4
4
|
import { ReadFlaunchPositionManagerV1_1 } from "./FlaunchPositionManagerV1_1Client";
|
|
5
5
|
export type FlaunchZapABI = typeof FlaunchZapAbi;
|
|
6
6
|
export interface FlaunchParams {
|
|
@@ -16,6 +16,7 @@ export interface FlaunchParams {
|
|
|
16
16
|
premineAmount?: bigint;
|
|
17
17
|
treasuryManagerParams?: {
|
|
18
18
|
manager?: Address;
|
|
19
|
+
permissions?: Permissions;
|
|
19
20
|
initializeData?: HexString;
|
|
20
21
|
depositData?: HexString;
|
|
21
22
|
};
|
|
@@ -24,6 +25,9 @@ export interface FlaunchIPFSParams extends Omit<FlaunchParams, "tokenUri">, IPFS
|
|
|
24
25
|
}
|
|
25
26
|
export interface FlaunchWithRevenueManagerParams extends Omit<FlaunchParams, "treasuryManagerParams"> {
|
|
26
27
|
revenueManagerInstanceAddress: Address;
|
|
28
|
+
treasuryManagerParams?: {
|
|
29
|
+
permissions?: Permissions;
|
|
30
|
+
};
|
|
27
31
|
}
|
|
28
32
|
export interface FlaunchWithRevenueManagerIPFSParams extends Omit<FlaunchWithRevenueManagerParams, "tokenUri">, IPFSParams {
|
|
29
33
|
}
|
|
@@ -33,6 +37,9 @@ export interface FlaunchWithSplitManagerParams extends Omit<FlaunchParams, "trea
|
|
|
33
37
|
address: Address;
|
|
34
38
|
percent: number;
|
|
35
39
|
}[];
|
|
40
|
+
treasuryManagerParams?: {
|
|
41
|
+
permissions?: Permissions;
|
|
42
|
+
};
|
|
36
43
|
}
|
|
37
44
|
export interface FlaunchWithSplitManagerIPFSParams extends Omit<FlaunchWithSplitManagerParams, "tokenUri">, IPFSParams {
|
|
38
45
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlaunchZapClient.d.ts","sourceRoot":"","sources":["../../src/clients/FlaunchZapClient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,KAAK,EAEV,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,SAAS,EAEf,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"FlaunchZapClient.d.ts","sourceRoot":"","sources":["../../src/clients/FlaunchZapClient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,KAAK,EAEV,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,SAAS,EAEf,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAKlD,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACnD,OAAO,EAAE,8BAA8B,EAAE,MAAM,oCAAoC,CAAC;AAQpF,MAAM,MAAM,aAAa,GAAG,OAAO,aAAa,CAAC;AAEjD,MAAM,WAA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AAC,MAAM,EAAE,6BAA6B;IAiHnE;;;;OAIG;IACG,2BAA2B,CAAC,MAAM,EAAE,iCAAiC;CAW5E"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { type ReadContract, type Address, type Drift, type ReadWriteContract, type ReadWriteAdapter } from "@delvtech/drift";
|
|
2
|
+
import { TreasuryManagerAbi } from "../abi/TreasuryManager";
|
|
3
|
+
export type TreasuryManagerABI = typeof TreasuryManagerAbi;
|
|
4
|
+
export type FlaunchToken = {
|
|
5
|
+
flaunch: Address;
|
|
6
|
+
tokenId: bigint;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Client for interacting with the TreasuryManager contract in read-only mode
|
|
10
|
+
* Provides methods to query permissions and manager owner
|
|
11
|
+
*/
|
|
12
|
+
export declare class ReadTreasuryManager {
|
|
13
|
+
readonly contract: ReadContract<TreasuryManagerABI>;
|
|
14
|
+
/**
|
|
15
|
+
* Creates a new ReadTreasuryManager instance
|
|
16
|
+
* @param address - The address of the TreasuryManager contract
|
|
17
|
+
* @param drift - Optional drift instance for contract interactions (creates new instance if not provided)
|
|
18
|
+
* @throws Error if address is not provided
|
|
19
|
+
*/
|
|
20
|
+
constructor(address: Address, drift?: Drift);
|
|
21
|
+
/**
|
|
22
|
+
* Gets the permissions contract address
|
|
23
|
+
* @returns Promise<Address> - The address of the permissions contract
|
|
24
|
+
*/
|
|
25
|
+
permissions(): Promise<`0x${string}`>;
|
|
26
|
+
/**
|
|
27
|
+
* Gets the manager owner address
|
|
28
|
+
* @returns Promise<Address> - The address of the manager owner
|
|
29
|
+
*/
|
|
30
|
+
managerOwner(): Promise<`0x${string}`>;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Extended client for interacting with the TreasuryManager contract with write capabilities
|
|
34
|
+
* Provides methods to deposit tokens, set permissions, and transfer ownership
|
|
35
|
+
*/
|
|
36
|
+
export declare class ReadWriteTreasuryManager extends ReadTreasuryManager {
|
|
37
|
+
contract: ReadWriteContract<TreasuryManagerABI>;
|
|
38
|
+
constructor(address: Address, drift?: Drift<ReadWriteAdapter>);
|
|
39
|
+
/**
|
|
40
|
+
* Deposits a flaunch token to the treasury
|
|
41
|
+
* @param flaunchToken - The flaunch token to deposit
|
|
42
|
+
* @param creator - The address of the creator
|
|
43
|
+
* @param data - Additional data for the deposit
|
|
44
|
+
* @returns Promise<void>
|
|
45
|
+
*/
|
|
46
|
+
deposit(flaunchToken: FlaunchToken, creator: Address, data: `0x${string}`): Promise<`0x${string}`>;
|
|
47
|
+
/**
|
|
48
|
+
* Sets the permissions contract address
|
|
49
|
+
* @param permissions - The address of the new permissions contract
|
|
50
|
+
* @returns Promise<void>
|
|
51
|
+
*/
|
|
52
|
+
setPermissions(permissions: Address): Promise<`0x${string}`>;
|
|
53
|
+
/**
|
|
54
|
+
* Transfers the manager ownership to a new address
|
|
55
|
+
* @param newManagerOwner - The address of the new manager owner
|
|
56
|
+
* @returns Promise<void>
|
|
57
|
+
*/
|
|
58
|
+
transferManagerOwnership(newManagerOwner: Address): Promise<`0x${string}`>;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=TreasuryManagerClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TreasuryManagerClient.d.ts","sourceRoot":"","sources":["../../src/clients/TreasuryManagerClient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EAEtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D,MAAM,MAAM,kBAAkB,GAAG,OAAO,kBAAkB,CAAC;AAE3D,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;;GAGG;AACH,qBAAa,mBAAmB;IAC9B,SAAgB,QAAQ,EAAE,YAAY,CAAC,kBAAkB,CAAC,CAAC;IAE3D;;;;;OAKG;gBACS,OAAO,EAAE,OAAO,EAAE,KAAK,GAAE,KAAqB;IAW1D;;;OAGG;IACH,WAAW;IAIX;;;OAGG;IACH,YAAY;CAGb;AAED;;;GAGG;AACH,qBAAa,wBAAyB,SAAQ,mBAAmB;IACvD,QAAQ,EAAE,iBAAiB,CAAC,kBAAkB,CAAC,CAAC;gBAGtD,OAAO,EAAE,OAAO,EAChB,KAAK,GAAE,KAAK,CAAC,gBAAgB,CAAiB;IAKhD;;;;;;OAMG;IACH,OAAO,CAAC,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,MAAM,EAAE;IAQzE;;;;OAIG;IACH,cAAc,CAAC,WAAW,EAAE,OAAO;IAMnC;;;;OAIG;IACH,wBAAwB,CAAC,eAAe,EAAE,OAAO;CAKlD"}
|
|
@@ -1,12 +1,28 @@
|
|
|
1
|
-
import { type ReadContract, type Address, type Drift, type ReadWriteContract } from "@delvtech/drift";
|
|
1
|
+
import { type ReadContract, type Address, type Drift, type ReadWriteContract, type HexString } from "@delvtech/drift";
|
|
2
2
|
import { TreasuryManagerFactoryAbi } from "../abi/TreasuryManagerFactory";
|
|
3
|
+
import { Permissions } from "types";
|
|
3
4
|
export type TreasuryManagerFactoryABI = typeof TreasuryManagerFactoryAbi;
|
|
5
|
+
export interface DeployRevenueManagerParams {
|
|
6
|
+
protocolRecipient: Address;
|
|
7
|
+
protocolFeePercent: number;
|
|
8
|
+
permissions?: Permissions;
|
|
9
|
+
}
|
|
10
|
+
export interface DeployStakingManagerParams {
|
|
11
|
+
managerOwner: Address;
|
|
12
|
+
stakingToken: Address;
|
|
13
|
+
minEscrowDuration: bigint;
|
|
14
|
+
minStakeDuration: bigint;
|
|
15
|
+
creatorSharePercent: number;
|
|
16
|
+
ownerSharePercent: number;
|
|
17
|
+
permissions?: Permissions;
|
|
18
|
+
}
|
|
4
19
|
export declare class ReadTreasuryManagerFactory {
|
|
20
|
+
chainId: number;
|
|
5
21
|
readonly contract: ReadContract<TreasuryManagerFactoryABI>;
|
|
6
|
-
constructor(address: Address, drift?: Drift);
|
|
22
|
+
constructor(chainId: number, address: Address, drift?: Drift);
|
|
23
|
+
getManagerDeployedAddressFromTx(hash: HexString): Promise<`0x${string}`>;
|
|
7
24
|
}
|
|
8
25
|
export declare class ReadWriteTreasuryManagerFactory extends ReadTreasuryManagerFactory {
|
|
9
|
-
chainId: number;
|
|
10
26
|
contract: ReadWriteContract<TreasuryManagerFactoryABI>;
|
|
11
27
|
constructor(chainId: number, address: Address, drift?: Drift);
|
|
12
28
|
/**
|
|
@@ -14,11 +30,22 @@ export declare class ReadWriteTreasuryManagerFactory extends ReadTreasuryManager
|
|
|
14
30
|
* @param params - Parameters for deploying the revenue manager
|
|
15
31
|
* @param params.protocolRecipient - The address of the protocol recipient
|
|
16
32
|
* @param params.protocolFeePercent - The percentage of the protocol fee
|
|
33
|
+
* @param params.permissions - The permissions for the revenue manager
|
|
34
|
+
* @returns Transaction response
|
|
35
|
+
*/
|
|
36
|
+
deployRevenueManager(params: DeployRevenueManagerParams): Promise<`0x${string}`>;
|
|
37
|
+
/**
|
|
38
|
+
* Deploys a new staking manager
|
|
39
|
+
* @param params - Parameters for deploying the staking manager
|
|
40
|
+
* @param params.managerOwner - The address of the manager owner
|
|
41
|
+
* @param params.stakingToken - The address of the token to be staked
|
|
42
|
+
* @param params.minEscrowDuration - The minimum duration (in seconds) that the creator's NFT is locked for
|
|
43
|
+
* @param params.minStakeDuration - The minimum duration (in seconds) that the user's tokens are locked for
|
|
44
|
+
* @param params.creatorSharePercent - The % share that a creator will earn from their token
|
|
45
|
+
* @param params.ownerSharePercent - The % share that the manager owner will earn from their token
|
|
46
|
+
* @param params.permissions - The permissions for the staking manager
|
|
17
47
|
* @returns Transaction response
|
|
18
48
|
*/
|
|
19
|
-
|
|
20
|
-
protocolRecipient: Address;
|
|
21
|
-
protocolFeePercent: number;
|
|
22
|
-
}): Promise<`0x${string}`>;
|
|
49
|
+
deployStakingManager(params: DeployStakingManagerParams): Promise<`0x${string}`>;
|
|
23
50
|
}
|
|
24
51
|
//# sourceMappingURL=TreasuryManagerFactoryClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreasuryManagerFactoryClient.d.ts","sourceRoot":"","sources":["../../src/clients/TreasuryManagerFactoryClient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,KAAK,EAEV,KAAK,iBAAiB,
|
|
1
|
+
{"version":3,"file":"TreasuryManagerFactoryClient.d.ts","sourceRoot":"","sources":["../../src/clients/TreasuryManagerFactoryClient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,KAAK,EAEV,KAAK,iBAAiB,EAEtB,KAAK,SAAS,EAEf,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAE1E,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAIpC,MAAM,MAAM,yBAAyB,GAAG,OAAO,yBAAyB,CAAC;AAEzE,MAAM,WAAW,0BAA0B;IACzC,iBAAiB,EAAE,OAAO,CAAC;IAC3B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B;AAED,MAAM,WAAW,0BAA0B;IACzC,YAAY,EAAE,OAAO,CAAC;IACtB,YAAY,EAAE,OAAO,CAAC;IACtB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,gBAAgB,EAAE,MAAM,CAAC;IACzB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B;AAED,qBAAa,0BAA0B;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAgB,QAAQ,EAAE,YAAY,CAAC,yBAAyB,CAAC,CAAC;gBAEtD,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,GAAE,KAAqB;IAWrE,+BAA+B,CAAC,IAAI,EAAE,SAAS;CA2BtD;AAED,qBAAa,+BAAgC,SAAQ,0BAA0B;IACrE,QAAQ,EAAE,iBAAiB,CAAC,yBAAyB,CAAC,CAAC;gBAEnD,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,GAAE,KAAqB;IAI3E;;;;;;;OAOG;IACH,oBAAoB,CAAC,MAAM,EAAE,0BAA0B;IA8BvD;;;;;;;;;;;OAWG;IACH,oBAAoB,CAAC,MAAM,EAAE,0BAA0B;CAuCxD"}
|
package/dist/helpers/index.cjs
CHANGED
|
@@ -5502,9 +5502,70 @@ const chainIdToChain = {
|
|
|
5502
5502
|
[baseSepolia.id]: baseSepolia,
|
|
5503
5503
|
};
|
|
5504
5504
|
|
|
5505
|
+
/**
|
|
5506
|
+
* Enumeration of Flaunch contract versions
|
|
5507
|
+
*/
|
|
5508
|
+
var FlaunchVersion;
|
|
5509
|
+
(function (FlaunchVersion) {
|
|
5510
|
+
FlaunchVersion["V1"] = "V1";
|
|
5511
|
+
FlaunchVersion["V1_1"] = "V1_1";
|
|
5512
|
+
FlaunchVersion["V1_1_1"] = "V1_1_1";
|
|
5513
|
+
FlaunchVersion["ANY"] = "ANY";
|
|
5514
|
+
})(FlaunchVersion || (FlaunchVersion = {}));
|
|
5515
|
+
/**
|
|
5516
|
+
* Enumeration of Verifiers for TokenImporter
|
|
5517
|
+
*/
|
|
5518
|
+
var Verifier;
|
|
5519
|
+
(function (Verifier) {
|
|
5520
|
+
Verifier["CLANKER"] = "clanker";
|
|
5521
|
+
Verifier["DOPPLER"] = "doppler";
|
|
5522
|
+
Verifier["VIRTUALS"] = "virtuals";
|
|
5523
|
+
Verifier["WHITELIST"] = "whitelist";
|
|
5524
|
+
Verifier["ZORA"] = "zora";
|
|
5525
|
+
})(Verifier || (Verifier = {}));
|
|
5526
|
+
/**
|
|
5527
|
+
* Enumeration of Permissions for TreasuryManagers. Defaults to OPEN.
|
|
5528
|
+
*/
|
|
5529
|
+
var Permissions;
|
|
5530
|
+
(function (Permissions) {
|
|
5531
|
+
Permissions["OPEN"] = "open";
|
|
5532
|
+
Permissions["CLOSED"] = "closed";
|
|
5533
|
+
Permissions["WHITELISTED"] = "whitelisted";
|
|
5534
|
+
})(Permissions || (Permissions = {}));
|
|
5535
|
+
|
|
5536
|
+
/** ======== */
|
|
5537
|
+
/** Permissions */
|
|
5538
|
+
const ClosedPermissionsAddress = {
|
|
5539
|
+
[base.id]: "0x0000000000000000000000000000000000000000", // TODO: add mainnet address
|
|
5540
|
+
[baseSepolia.id]: "0x551aeD820CAfaca2f9cD1C637AAc076D05a03AC2",
|
|
5541
|
+
};
|
|
5542
|
+
const WhitelistedPermissionsAddress = {
|
|
5543
|
+
[base.id]: "0x0000000000000000000000000000000000000000", // TODO: add mainnet address
|
|
5544
|
+
[baseSepolia.id]: "0xe8691E8f576A98c41EBB5E984207d4F51386621f",
|
|
5545
|
+
};
|
|
5546
|
+
|
|
5547
|
+
/**
|
|
5548
|
+
* Maps a Permissions enum value to its corresponding contract address
|
|
5549
|
+
* @param permissions - The permissions enum value
|
|
5550
|
+
* @param chainId - The chain ID to get the address for
|
|
5551
|
+
* @returns The corresponding permissions contract address
|
|
5552
|
+
*/
|
|
5553
|
+
function getPermissionsAddress(permissions, chainId) {
|
|
5554
|
+
switch (permissions) {
|
|
5555
|
+
case Permissions.CLOSED:
|
|
5556
|
+
return ClosedPermissionsAddress[chainId];
|
|
5557
|
+
case Permissions.WHITELISTED:
|
|
5558
|
+
return WhitelistedPermissionsAddress[chainId];
|
|
5559
|
+
case Permissions.OPEN:
|
|
5560
|
+
default:
|
|
5561
|
+
return viem.zeroAddress;
|
|
5562
|
+
}
|
|
5563
|
+
}
|
|
5564
|
+
|
|
5505
5565
|
exports.bytes32ToUint256 = bytes32ToUint256;
|
|
5506
5566
|
exports.chainIdToChain = chainIdToChain;
|
|
5507
5567
|
exports.generateTokenUri = generateTokenUri;
|
|
5568
|
+
exports.getPermissionsAddress = getPermissionsAddress;
|
|
5508
5569
|
exports.resolveIPFS = resolveIPFS;
|
|
5509
5570
|
exports.uint256ToBytes32 = uint256ToBytes32;
|
|
5510
5571
|
exports.uploadFileToIPFS = uploadFileToIPFS;
|