Index

src/user/schemas/access-request.schema.ts

AccessRequestSchema
Default value : SchemaFactory.createForClass(AccessRequest)

src/common/provider/mail/templates/MessageTemplate.ts

addMessageToTemplate
Default value : ({ message }) => { const notificationTime = new Date().toLocaleString("en-US", options); return ` <div> <img src="https://drive.google.com/uc?export=view&id=1RyOjHw6NpiMJhTdmte1kHpCNJMea8rRy" alt="" width="196px" height="90px" /> <p> <b>${notificationTime}</b> </p> <p>Hi,</p> <p>${message}<p> Best Regards, <p>Libre Team</p> </div> `; }
options
Type : Intl.DateTimeFormatOptions
Default value : { year: "numeric", month: "short", day: "numeric", hour: "2-digit", minute: "2-digit", second: "2-digit", }

src/common/provider/mail/templates/OrderTemplate.ts

addMessageToTemplate
Default value : ({ message, fundName }) => { const notificationTime = new Date().toLocaleString("en-US", options); return ` <div> <img src="https://drive.google.com/uc?export=view&id=1RyOjHw6NpiMJhTdmte1kHpCNJMea8rRy" alt="" width="196px" height="90px" /> <p> <b>${notificationTime}</b> </p> <p> Hi, </p> <div>${message}<div> <p> For and on Behalf of <b>${fundName}</b> </p> Best Regards, <p>Libre Team</p> </div> `; }
options
Type : Intl.DateTimeFormatOptions
Default value : { year: "numeric", month: "short", day: "numeric", hour: "2-digit", minute: "2-digit", second: "2-digit", }

test/constants/accessToken.ts

AdminAccessToken
Type : string
Default value : "eyJraWQiOiJYQ0dpeDdkQkNyUzViR3JpbFJ6VEZrZHczS2d5WG5pT0pxNXI0eENmYkNvPSIsImFsZyI6IlJTMjU2In0.eyJzdWIiOiI4NDFhZWMxNy1hMzkyLTRmNTctYTJhZC1iMDI3NjgwZmUwODYiLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLXdlc3QtMi5hbWF6b25hd3MuY29tXC91cy13ZXN0LTJfVjFURVg3a09hIiwiY29nbml0bzp1c2VybmFtZSI6Ijg0MWFlYzE3LWEzOTItNGY1Ny1hMmFkLWIwMjc2ODBmZTA4NiIsIm9yaWdpbl9qdGkiOiI4Y2Y0YzY2Ni05MDFjLTRkMmQtODU1Yy1mMWJjYTcxOTM1YjUiLCJhdWQiOiIxNWRvdTNoZjBvbmN2b3U4ajViNG9uYnB1NyIsImV2ZW50X2lkIjoiZmU5OTIxMzctMGJlMS00YmU2LTlmYzAtNjIzNzhiNDIzYjM4IiwidG9rZW5fdXNlIjoiaWQiLCJhdXRoX3RpbWUiOjE2OTc0Mzk1NTMsImV4cCI6MTY5NzUyNTk1MywiY3VzdG9tOnJvbGUiOiJhZG1pbiIsImlhdCI6MTY5NzQzOTU1MywianRpIjoiMjE0MjhkMzctMjg1ZS00YmZkLWFlNDEtYjlkOTcxMjU1OWJhIiwiZW1haWwiOiJhZG1pbkBuZXRoZXJtaW5kLmlvIn0.m4UL6faMFuzH52wVB4kp6-JiimwyYkiA3Gk5RMl-uJLrTdbBSYxMKBa110LvKOSlkpAeafaz9Fzh6P3JgWq0I3lCtDpMNdKZXHgitjHiwA4-XMtqFtSyLj0uNT_43a0PHFfuxyj762h0azPlFI6KPTox2hziPlrFjUBldvMY2mTrXdCjWHc65GlWNjdg6zIzU_tZzQI9Q6HDeSm3ImjKLAA1B5XKgFMSlHp8SD9NVJ6_3_-IfgED_C5kfhkQ0yGG9VEwijl2CGS23TeDY-AutDbd3SM-Vmi1kL6YvlVgZm6MrRbj6dH3Ob3GDgEbEoZHv1KexD22FvqpF9kRHIIVOA"
DealerAccessToken
Type : string
Default value : ""
FundAdminAccessToken
Type : string
Default value : ""
InvestorAccessToken
Type : string
Default value : ""

src/admin-profile/schemas/admin.schema.ts

AdminSchema
Default value : SchemaFactory.createForClass(Admin)

test/constants/constants.ts

adminWalletMock
Type : string
Default value : "0xfe3b557e8fb62b89f4916b721be55ceb828dbd73"
Dealer_otp_secret
Type : string
Default value : "YMYQCGD7C5JKYPLGLXV42N5VJ5VE26BIVT3OBDLATMWJ63725HDQ===="
Dealer_Unassigned_otp_secret
Type : string
Default value : "7UEW237RTLE2JY54TQ322KPEMFNVVGKT6KBHBNAIWD5GYWRHIATA===="
Fund_Admin_otp_secret
Type : string
Default value : "6MMGUPYGCSE4EEYJD6MESVQNAWZXCHQSZ7BPYSLB2HET7XIHBXVA===="
fundMock
Default value : Object.freeze({ title: "Brevan Howard", longDescription: "Invest with Associated fund and redeem anytime", shortDescription: "Invest with Associated fund the best Associated price", logoFile: S3File, type: "Hedge Fund", brochureFile: S3File, keyDocumentsFile: S3File, extraDocumentsFile: S3File, fees: "1.5%", partiesFile: S3File, disclaimer: "I am disclaming", promotionVideoFile: S3File, fundType: "Hedge Fund", sector: "finance", location: "here the location is here", performance: { data: "this file is important", file: S3File, }, strategy: { data: "this file is important", file: S3File, }, bankDetails: { bankName: "The bank name", bankAddress: "The bank address", bankChaps: "The bank chaps", bankBic: "The bank bic", accountNo: "Account number", accountBic: "The account Bic", accountName: "The bank account name", ibanNo: "The IBAN number", ultimateName: "Th ultimate name", ultimateAccountNo: "The ultimate account no ", currency: "USD", abaCode: "The aba code", }, })
instrumentMock
Default value : Object.freeze({ name: `Share Class T`, symbol: "ClassTest", description: "Instrument for testing", type: "Global Macro", cmsFields: [], })
instrumentMockSetup
Default value : Object.freeze({ registryName: "InstrumentRegistry", registries: [ { dataFieldType: "Bool", dataFieldName: "INVESTOR_ALLOWLISTED_REQUIRED", dataFieldValue: "true", }, { dataFieldType: "Uint", dataFieldName: "LOOKBACK_PERIOD", dataFieldValue: "1", }, { dataFieldType: "Uint", dataFieldName: "LOOKBACK_PERIOD_UNIT", dataFieldValue: "86400", }, { dataFieldType: "Uint", dataFieldName: "TOP_UP_PERIOD", dataFieldValue: "1", }, { dataFieldType: "Uint", dataFieldName: "TOP_UP_PERIOD_UNIT", dataFieldValue: "86400", }, { dataFieldType: "Uint", dataFieldName: "GLOBAL_AGGREGATE_MINIMUM", dataFieldValue: "2000000000000", }, { dataFieldType: "Uint", dataFieldName: "LOCAL_AGGREGATE_MINIMUM", dataFieldValue: "2000000000000", }, { dataFieldType: "Uint", dataFieldName: "LOCAL_INVESTOR_MINIMUM", dataFieldValue: "200000000000", }, { dataFieldType: "Uint", dataFieldName: "LOCAL_SUBSEQUENT_MINIMUM", dataFieldValue: "200000000000", }, { dataFieldType: "Uint", dataFieldName: "REDEMPTION_TIME_CUTOFF", dataFieldValue: "25200", }, { dataFieldType: "Uint", dataFieldName: "NOTICE_PERIOD", dataFieldValue: "1", }, { dataFieldType: "Uint", dataFieldName: "NOTICE_PERIOD_UNIT", dataFieldValue: "86400", }, { dataFieldType: "Uint", dataFieldName: "REDEMPTION_START", dataFieldValue: "865717200", }, { dataFieldType: "Uint", dataFieldName: "REDEMPTION_END", dataFieldValue: "872014660", }, { dataFieldType: "Uint", dataFieldName: "REDEMPTION_FREQUENCY", dataFieldValue: "1", }, { dataFieldType: "Uint", dataFieldName: "REDEMPTION_FREQUENCY_TIME_UNIT", dataFieldValue: "629746", }, { dataFieldType: "Uint", dataFieldName: "REDEMPTION_PHASES", dataFieldValue: "0", }, { dataFieldType: "Uint", dataFieldName: "SUBSCRIPTION_START", dataFieldValue: "865717200", }, { dataFieldType: "Uint", dataFieldName: "SUBSCRIPTION_END", dataFieldValue: "872014660", }, { dataFieldType: "Uint", dataFieldName: "DEALING_FREQUENCY", dataFieldValue: "1", }, { dataFieldType: "Uint", dataFieldName: "DEALING_FREQUENCY_TIME_UNIT", dataFieldValue: "629746", }, { dataFieldType: "Uint", dataFieldName: "SUBSCRIPTION_PHASES", dataFieldValue: "0", }, { dataFieldType: "Uint", dataFieldName: "DEALING_CUT_OFF", dataFieldValue: "1814400", }, { dataFieldType: "Uint", dataFieldName: "DEALING_CUT_OFF_TIME", dataFieldValue: "72000", }, { dataFieldType: "Uint", dataFieldName: "INVESTMENT_SIZE", dataFieldValue: "1", }, { dataFieldType: "Uint", dataFieldName: "MIN_SUB_INV", dataFieldValue: "1", }, { dataFieldType: "Uint", dataFieldName: "MAXIMUM_BIDDING_AMOUNT", dataFieldValue: "200000000000000000000000000000", }, { dataFieldType: "Uint", dataFieldName: "MAXIMUM_BIDDING_QUEUE_SIZE", dataFieldValue: "3", }, { dataFieldType: "Uint", dataFieldName: "GATE_CRITERIA_1", dataFieldValue: "1", }, { dataFieldType: "Uint", dataFieldName: "VOLUME_LIMIT", dataFieldValue: "1000", }, ], })
Investor_otp_secret
Type : string
Default value : "KY7ULWWDHIKANKRJ4M62ERDF763NSCTUBMHOTZKULFNU7N4IQILA===="
JurisdictionSetup
Default value : Object.freeze({ newFields: [ { id: "ALL_DEALERS", dataFieldType: "Bool", dataFieldName: "JURISDICTION_ALLOWED", dataFieldValue: "true", dataFieldLinkedName: "INVESTOR_TYPE", dataFieldLinkedType: "Uint", }, { id: "ALL_DEALERS", dataFieldType: "Bool", dataFieldName: "IS_KYC_REQUIRED", dataFieldValue: "true", dataFieldLinkedName: "KYC_PASSED", dataFieldLinkedType: "Bool", }, { id: "ALL_DEALERS", dataFieldType: "Bool", dataFieldName: "IS_AML_REQUIRED", dataFieldValue: "true", dataFieldLinkedName: "AML_PASSED", dataFieldLinkedType: "Bool", }, { id: "ALL_DEALERS", dataFieldType: "Bool", dataFieldName: "IS_SANCTION_REQUIRED", dataFieldValue: "true", dataFieldLinkedName: "SANCTIONS_PASSED", dataFieldLinkedType: "Bool", }, { id: "ALL_DEALERS", dataFieldType: "Bool", dataFieldName: "IS_RESIDENCE_ALLOWED", dataFieldValue: "true", dataFieldLinkedName: "RESIDENCE", dataFieldLinkedType: "Uint", }, { id: "ALL_DEALERS", dataFieldType: "Bool", dataFieldName: "IS_JURISDICTION_ALLOWED", dataFieldValue: "true", dataFieldLinkedName: "JURISDICTION_ALLOWED", dataFieldLinkedType: "Bool", }, { id: "ALL_DEALERS", dataFieldType: "Bool", dataFieldName: "SELF_CERTIFICATION_REQUIRED", dataFieldValue: "true", dataFieldLinkedName: "SELF_CERTIFICATED", dataFieldLinkedType: "Bool", }, { id: "ALL_DEALERS", dataFieldType: "Bool", dataFieldName: "FITNESS_TEST_REQUIRED", dataFieldValue: "true", dataFieldLinkedName: "FITNESS_TEST", dataFieldLinkedType: "Bool", }, { id: "ALL_DEALERS", dataFieldType: "Bool", dataFieldName: "NO_MINIMUM_INVESTMENT_HOLDER_NUMBER", dataFieldValue: "true", dataFieldLinkedName: "MINIMUM_INVESTMENT_HOLDER_NUMBER", dataFieldLinkedType: "Uint", }, { id: "ALL_DEALERS", dataFieldType: "Bool", dataFieldName: "IS_NEXT_REVIEW_DATE", dataFieldValue: "true", dataFieldLinkedName: "REVIEW_DATE", dataFieldLinkedType: "Uint", }, { id: "826", dataFieldType: "Bool", dataFieldName: "JURISDICTION_ALLOWED", dataFieldValue: "true", dataFieldLinkedName: "RESIDENCE", dataFieldLinkedType: "Uint", }, ], })
Platform_Admin_otp_secret
Type : string
Default value : "M6V7EYRUOUGCDYXZILHSZTQ3KOTQN6YFSYN7OQ7MUJV4JQPULGEQ===="
queryTxMock
Default value : Object.freeze({ queryName: "balanceOf", contractName: "erc20", args: ["0xfe3b557e8fb62b89f4916b721be55ceb828dbd73"], })
requestMock
Default value : Object.freeze({ title: "Deploy a new instrument", content: "The master fund created a new instrument. We need to do the same.", })
submitTxMock
Default value : Object.freeze({ transactionName: "transfer", contractName: "erc20", args: [ "0x877427CCBd3061Affd5c6518bc87799B9Cf3C408", parseEther("0.00001").toString(), ], })
TestRelayerKey
Type : string
Default value : "Mokbx2oC3uRB5/5mEHJqRW7iws3TmfLdCNVXJN+3fTV6+fcfSn3WkgZyCDx+BAtBAzaxNy79g7LlfiyPbVC7qtBHtWRp8FsWpWzh3F42lTxAJb5FJQu4oRBzZupx33kShb1D4klT4zc68T5SvtEAxoZTPRED67UxnkDHYGoT1hSM1XajYsItYuEGeokQ7TgzacoD4ABn5iF4ythMpo0oRh0D1rL+9zY9Uw3GkBrpNpUewlGyGyv2JIiBLPjeWUByMqSeAP3b6bjgDm7Em6JSpkkz6nYfmyP2kT/An+H1E1VHBMUCHM0qCWzUs21oz1JAaAdIWS+D/2eZl8obe5L+WA=="
userByRole
Default value : Object.freeze({ admin: { email: "admin@nethermind.io", password: "GTY1304yhij$", }, investor: { email: "yehiatarek1997@gmail.com", password: "Password123$", }, investorSubmitTx: { email: "yehiatarek1997@gmail.com", password: "Password123$", }, fundAdmin: { email: "yehia@startfi.io", password: "Password123$", }, dealer: { email: "yehiatarek67@gmail.com", password: "Password123$", }, unAssignedDealer: { email: "test1@test.io", password: "Password123$", }, })

src/common/constants/defaultValues.ts

ALL_DEALER
Default value : Object.freeze( keccak256(hexlify(toUtf8Bytes("ALL_DEALER"))), )
BLOCKCHAIN_EXPLORER
Type : string
Default value : "https://blockscout.dev.librecapital.com"
DEFAULT_LIBRE_DEALER
Type : string
Default value : "yehiatarek67@gmail.com"
DEFAULT_USER_ADDRESS
Type : string
Default value : "The address is not provided"
defaultWalletLabel
Type : string
Default value : "default wallet"
EncryptionAlgorithm
Type : string
Default value : "RSAES_OAEP_SHA_256"
INIT_SET_BATCH
Type : IBatch
Default value : Object.freeze({ _id: [], _keys: [], _boolValues: [], _uintValues: [], _addressValues: [], _stringValues: [], _bytesValues: [], _senderRole: "", })
JurisdictionDefaultValues
Type : IJurisdictionDefaultValues
Default value : Object.freeze({ isKycEnabled: { dataFieldCol: "KYC_PASSED", dataFieldColHash: keccak256(hexlify(toUtf8Bytes("KYC_PASSED"))), type: DataFieldType.Bool, }, isAmlEnabled: { dataFieldCol: "AML_PASSED", dataFieldColHash: keccak256(hexlify(toUtf8Bytes("AML_PASSED"))), type: DataFieldType.Bool, }, isSanctionPassed: { dataFieldCol: "SANCTIONS_PASSED", dataFieldColHash: keccak256(hexlify(toUtf8Bytes("SANCTIONS_PASSED"))), type: DataFieldType.Bool, }, location: { dataFieldCol: "LOCATION", dataFieldColHash: keccak256(hexlify(toUtf8Bytes("LOCATION"))), type: DataFieldType.Uint, }, investorType: { dataFieldCol: "INVESTOR_TYPE", dataFieldColHash: keccak256(hexlify(toUtf8Bytes("INVESTOR_TYPE"))), type: DataFieldType.Uint, }, })
TypeToDefaultValue
Type : Record<DataFieldType, string>
Default value : Object.freeze({ Uint: "0", Bool: "false", String: "", Bytes: "0x", Address: "0x", AddressArrayIndexValue: "[]", getAddressArray: "[]", })
zeroAddress
Type : string
Default value : "0x0000000000000000000000000000000000000000"

src/orderbook/schemas/allowance.schema.ts

AllowanceSchema
Default value : SchemaFactory.createForClass(Allowance)

src/common/provider/mail/templates/allowInstrumentAccess.ts

AllowInstrumentAccessTemplate
Default value : ({ investor, instrumentName, }: IAllowInstrumentAccess) => { const message = `Investor, ${investor.name} with email ${investor.email}, has now been approved by the fund admin to access the instrument ${instrumentName}`; const email = addMessageToTemplate({ message, }); return email; }

src/common/provider/mail/templates/allowInvestorAccess.ts

AllowInvestorAccessTemplate
Default value : ({ investor, fundName, }: IAllowInvestorAccessTemplate) => { const message = `Investor, ${investor.name} with email ${investor.email}, has now been approved by the fund admin for access to ${fundName}`; const email = addMessageToTemplate({ message, }); return email; }

src/common/provider/thegraph/apolloClient.ts

apolloClient
Default value : new ApolloClient({ uri: process.env.GRAPHQL_URI, cache: new InMemoryCache(), defaultOptions, })
defaultOptions
Type : DefaultOptions
Default value : { watchQuery: { fetchPolicy: "cache-and-network", errorPolicy: "all", }, query: { fetchPolicy: "network-only", errorPolicy: "all", }, }

src/shared/schemas/BankDetails.schema.ts

BankDetailsSchema
Default value : SchemaFactory.createForClass(BankDetails)

src/common/constants/CacheConfig.ts

CACHE_TIME
Default value : 60 * 60 * 5 * 1000
STORE_CACHE_TIME
Default value : 60 * 60 * 1000

src/user/user.cms.service.ts

CMS_BASE_URL
Default value : process.env.CMS_BASE_URL
cmsPayloadConfig
Type : object
Default value : { headers: { "Content-Type": "application/json", Authorization: `bearer ${process.env.CMS_API_KEY}`, }, }

src/common/utils/convertToHexPaddedString.ts

convertToPaddedHexString
Default value : (str) => { const intValue = parseInt(str); // Convert the input string to an integer value const hexValue = intValue.toString(16); // Convert the integer to a hexadecimal string const paddedHexString = hexValue.padStart(64, "0"); // Pad the hexadecimal string to have a length of 64 characters with leading zeros const finalHexString = "0x" + paddedHexString; // Add "0x" prefix to indicate a hexadecimal value return finalHexString; }

test/InstallFund.script.ts

createdFundId
Type : string
createdInstrument
Type : literal type

test/SystemSetup.script.ts

createdFundId
Type : string
createdInstrument
Type : literal type

src/common/utils/createPdfFromString.ts

createPDFFromString
Default value : async ( text: string, ): Promise<Uint8Array> => { const pdfDoc = await PDFDocument.create(); const page = pdfDoc.addPage(); const { width, height } = page.getSize(); const margin = 3; const usableWidth = width - 2 * margin; page.drawText(text, { x: margin, y: height - margin - 12, // Assuming 12pt font size size: 12, color: rgb(0, 0, 0), maxWidth: usableWidth, lineHeight: 14, // Assuming 2pt line spacing }); return await pdfDoc.save(); }

src/shared/custodial/schemas/custodial.schema.ts

CustodialSchema
Default value : SchemaFactory.createForClass(Custodial)

src/shared/artifacts/CustomErrors.ts

CustomRegistry
Default value : Object.freeze({ address: "", abis: [ { inputs: [], name: "AccessControlBadConfirmation", type: "error", }, { inputs: [ { internalType: "address", name: "account", type: "address", }, { internalType: "bytes32", name: "neededRole", type: "bytes32", }, ], name: "AccessControlUnauthorizedAccount", type: "error", }, { inputs: [ { internalType: "address", name: "target", type: "address", }, ], name: "AddressEmptyCode", type: "error", }, { inputs: [ { internalType: "address", name: "account", type: "address", }, ], name: "AddressInsufficientBalance", type: "error", }, { inputs: [], name: "FailedInnerCall", type: "error", }, { inputs: [], name: "AlreadyInitialized", type: "error", }, { inputs: [], name: "NotInitializing", type: "error", }, { inputs: [], name: "BaseRegistryAccessDenied", type: "error", }, { inputs: [], name: "BaseRegistryNotAValidId", type: "error", }, { inputs: [], name: "EternalRegistryAttemptToSetARestrictedKey", type: "error", }, { inputs: [], name: "EternalRegistryBatchLengthMismatch", type: "error", }, { inputs: [], name: "EternalRegistryIndexShouldBeLessThanLengthOfTheArray", type: "error", }, { inputs: [], name: "PermissionedContractAccessDenied", type: "error", }, { inputs: [], name: "BaseUserRegistryWalletAlreadyClaimed", type: "error", }, { inputs: [], name: "BaseUserRegistryWalletOwnershipVerificationFailure", type: "error", }, { inputs: [], name: "BaseUserRegistryWalletSignatureExpired", type: "error", }, { inputs: [], name: "DealerRegistryAlreadyADealer", type: "error", }, { inputs: [], name: "DealerRegistryInvalidInput", type: "error", }, { inputs: [ { internalType: "uint256", name: "length", type: "uint256", }, ], name: "ECDSAInvalidSignatureLength", type: "error", }, { inputs: [ { internalType: "bytes32", name: "s", type: "bytes32", }, ], name: "ECDSAInvalidSignatureS", type: "error", }, { inputs: [ { internalType: "address", name: "spender", type: "address", }, ], name: "ERC20InvalidSpender", type: "error", }, { inputs: [ { internalType: "address", name: "receiver", type: "address", }, ], name: "ERC20InvalidReceiver", type: "error", }, { inputs: [ { internalType: "address", name: "sender", type: "address", }, ], name: "ERC20InvalidSender", type: "error", }, { inputs: [ { internalType: "address", name: "approver", type: "address", }, ], name: "ERC20InvalidApprover", type: "error", }, { inputs: [ { internalType: "address", name: "sender", type: "address", }, ], name: "ERC20InsufficientBalance", type: "error", }, { inputs: [ { internalType: "address", name: "spender", type: "address", }, ], name: "ERC20InsufficientAllowance", type: "error", }, { inputs: [ { internalType: "address", name: "sender", type: "address", }, { internalType: "uint256", name: "tokenId", type: "uint256", }, { internalType: "address", name: "owner", type: "address", }, ], name: "ERC721IncorrectOwner", type: "error", }, { inputs: [ { internalType: "address", name: "operator", type: "address", }, { internalType: "uint256", name: "tokenId", type: "uint256", }, ], name: "ERC721InsufficientApproval", type: "error", }, { inputs: [ { internalType: "address", name: "approver", type: "address", }, ], name: "ERC721InvalidApprover", type: "error", }, { inputs: [ { internalType: "address", name: "operator", type: "address", }, ], name: "ERC721InvalidOperator", type: "error", }, { inputs: [ { internalType: "address", name: "owner", type: "address", }, ], name: "ERC721InvalidOwner", type: "error", }, { inputs: [ { internalType: "address", name: "receiver", type: "address", }, ], name: "ERC721InvalidReceiver", type: "error", }, { inputs: [ { internalType: "address", name: "sender", type: "address", }, ], name: "ERC721InvalidSender", type: "error", }, { inputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, ], name: "ERC721NonexistentToken", type: "error", }, { inputs: [ { internalType: "address", name: "operator", type: "address", }, { internalType: "address", name: "owner", type: "address", }, ], name: "ERC1155InsufficientApprovalForAll", type: "error", }, { inputs: [ { internalType: "address", name: "sender", type: "address", }, { internalType: "uint256", name: "balance", type: "uint256", }, { internalType: "uint256", name: "needed", type: "uint256", }, { internalType: "uint256", name: "tokenId", type: "uint256", }, ], name: "ERC1155InsufficientBalance", type: "error", }, { inputs: [ { internalType: "address", name: "approver", type: "address", }, ], name: "ERC1155InvalidApprover", type: "error", }, { inputs: [ { internalType: "uint256", name: "idsLength", type: "uint256", }, { internalType: "uint256", name: "valuesLength", type: "uint256", }, ], name: "ERC1155InvalidArrayLength", type: "error", }, { inputs: [ { internalType: "address", name: "operator", type: "address", }, ], name: "ERC1155InvalidOperator", type: "error", }, { inputs: [ { internalType: "address", name: "receiver", type: "address", }, ], name: "ERC1155InvalidReceiver", type: "error", }, { inputs: [ { internalType: "address", name: "sender", type: "address", }, ], name: "ERC1155InvalidSender", type: "error", }, { inputs: [], name: "FundRegistryAlreadyRegistered", type: "error", }, { inputs: [], name: "ERC1167FailedCreateClone", type: "error", }, { inputs: [], name: "InstrumentRegistryInstrumentAlreadyExists", type: "error", }, { inputs: [], name: "TimestampNotIncreasing", type: "error", }, { inputs: [], name: "ECDSAInvalidSignature", type: "error", }, { inputs: [], name: "InvestorRegistryAlreadyAnInvestor", type: "error", }, { inputs: [], name: "InvestorRegistryNotDealerRulesEngine", type: "error", }, { inputs: [], name: "InvestorRegistryNotInvestorsDealer", type: "error", }, { inputs: [], name: "InvestorRegistryNotJurisdictionRegistry", type: "error", }, { inputs: [], name: "InvestorRegistryNotRulesEngine", type: "error", }, { inputs: [], name: "InvestorRegistryOperationNotPermitted", type: "error", }, { inputs: [], name: "IOrderPipelineBeneficiaryIsNotInvestor", type: "error", }, { inputs: [], name: "IOrderPipelineInsufficientAmount", type: "error", }, { inputs: [], name: "IOrderPipelineOrderAlreadySettledInCurrentRound", type: "error", }, { inputs: [], name: "IOrderPipelineOrderCannotBeConfirmed", type: "error", }, { inputs: [], name: "IOrderPipelineOrderCannotBeLock", type: "error", }, { inputs: [], name: "IOrderPipelineOrderNotFound", type: "error", }, { inputs: [], name: "IOrderPipelineOrderNotLocked", type: "error", }, { inputs: [], name: "IOrderPipelinePaymentTokenTransferFailed", type: "error", }, { inputs: [], name: "IOrderPipelinePercentageNotApt", type: "error", }, { inputs: [], name: "IOrderPipelineUnauthorized", type: "error", }, { inputs: [], name: "IOrderPipelineWrongInvestor", type: "error", }, ], })

src/shared/artifacts/dealerRegistry.ts

DealerRegistry
Default value : Object.freeze({ address: "0xe979891Da8c2af95146ef2eE7C6eBD20cBda5F45", abis: [ ...CustomRegistry.abis, { inputs: [], name: "AlreadyInitialized", type: "error", }, { inputs: [], name: "BaseRegistryAccessDenied", type: "error", }, { inputs: [], name: "BaseRegistryNotAValidId", type: "error", }, { inputs: [], name: "BaseUserRegistryWalletAlreadyClaimed", type: "error", }, { inputs: [], name: "BaseUserRegistryWalletOwnershipVerificationFailure", type: "error", }, { inputs: [], name: "BaseUserRegistryWalletSignatureExpired", type: "error", }, { inputs: [], name: "DealerRegistryAlreadyADealer", type: "error", }, { inputs: [], name: "DealerRegistryInvalidInput", type: "error", }, { inputs: [], name: "ECDSAInvalidSignature", type: "error", }, { inputs: [ { internalType: "uint256", name: "length", type: "uint256", }, ], name: "ECDSAInvalidSignatureLength", type: "error", }, { inputs: [ { internalType: "bytes32", name: "s", type: "bytes32", }, ], name: "ECDSAInvalidSignatureS", type: "error", }, { inputs: [], name: "EternalRegistryAttemptToSetARestrictedKey", type: "error", }, { inputs: [], name: "EternalRegistryBatchLengthMismatch", type: "error", }, { inputs: [], name: "EternalRegistryIndexShouldBeLessThanLengthOfTheArray", type: "error", }, { inputs: [], name: "NotInitializing", type: "error", }, { inputs: [], name: "PermissionedContractAccessDenied", type: "error", }, { inputs: [ { internalType: "bytes32", name: "_senderRole", type: "bytes32", }, { internalType: "bytes32", name: "_dealerId", type: "bytes32", }, { internalType: "bytes32", name: "_instrumentId", type: "bytes32", }, { internalType: "bool", name: "_allowed", type: "bool", }, ], name: "allowDealer", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "bytes32", name: "_senderRole", type: "bytes32", }, { internalType: "bytes32", name: "_dealerId", type: "bytes32", }, { internalType: "address", name: "_wallet", type: "address", }, ], name: "addDealer", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "address", name: "wallet", type: "address", }, ], name: "addWallet", outputs: [], stateMutability: "nonpayable", type: "function", }, ], })

src/shared/artifacts/DealerRulesEngine.ts

DealerRulesEngine
Default value : Object.freeze({ address: "0x0Be199A777EECc870a7b13045946Fef1803Dd9e1", abis: [ { inputs: [], name: "PermissionedContractAccessDenied", type: "error", }, { inputs: [ { internalType: "address", name: "_module", type: "address", }, { internalType: "bool", name: "_status", type: "bool", }, { internalType: "bytes32", name: "_role", type: "bytes32", }, { internalType: "uint256", name: "_registrationTimestamp", type: "uint256", }, ], name: "editLibreModule", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "address", name: "_module", type: "address", }, { internalType: "bytes32", name: "_role", type: "bytes32", }, ], name: "deleteLibreModule", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "address", name: "_module", type: "address", }, { internalType: "bytes32", name: "_role", type: "bytes32", }, ], name: "registerLibreModule", outputs: [ { internalType: "address", name: "", type: "address", }, ], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "address", name: "_module", type: "address", }, ], name: "registerModule", outputs: [ { internalType: "address", name: "", type: "address", }, ], stateMutability: "nonpayable", type: "function", }, ], })

src/common/constants/Addresses.ts

DealerRulesEngineImpl
Type : string
Default value : "0x0Be199A777EECc870a7b13045946Fef1803Dd9e1"
PaymentToken
Type : string
Default value : "0x9a3DBCa554e9f6b9257aAa24010DA8377C57c17e"
RedemptionBookImpl
Type : string
Default value : "0xC538fd0A079856cE824089c9210AC2dd40C844d8"
RulesEngineAddress
Type : string
Default value : "0xBa590e0616272F94FdF886Da695782c7F9c0dC82"
SecurityTokenBookImpl
Type : string
Default value : "0x40975C6cacC3A693EF65183afF2c3418A0297850"
SubscriptionBookImpl
Type : string
Default value : "0x284f8B77512efF613A2873045626E7c34Fec09B0"
TreasuryWallet
Type : string
Default value : "0x877427CCBd3061Affd5c6518bc87799B9Cf3C408"

src/docusign/config/docusignClient.ts

DocuSignClient
Default value : new ApiClient({ basePath: process.env.DOCUSIGN_BASE_PATH, oAuthBasePath: oathBasePath, })
oathBasePath
Default value : process.env.NODE_ENV === "dev" ? "https://account-d.docusign.com/oauth/token" : "https://account.docusign.com/oauth/token"
START_QUERYING_FROM
Type : string
Default value : "2023-06-07T10:23:54.991Z"

src/shared/artifacts/erc20.ts

ERC20
Default value : Object.freeze({ abis: [ { constant: false, inputs: [ { name: "_to", type: "address", }, { name: "_value", type: "uint256", }, ], name: "transfer", outputs: [ { name: "", type: "bool", }, ], payable: false, stateMutability: "nonpayable", type: "function", }, { constant: false, inputs: [ { internalType: "address", name: "account", type: "address", }, ], name: "balanceOf", outputs: [ { internalType: "uint256", name: "", type: "uint256", }, ], stateMutability: "view", type: "function", payable: false, }, { inputs: [ { internalType: "address", name: "spender", type: "address", }, { internalType: "uint256", name: "amount", type: "uint256", }, ], name: "approve", outputs: [ { internalType: "bool", name: "", type: "bool", }, ], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "address", name: "to", type: "address", }, { internalType: "uint256", name: "amount", type: "uint256", }, ], name: "transfer", outputs: [ { internalType: "bool", name: "", type: "bool", }, ], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "address", name: "_account", type: "address", }, { internalType: "uint256", name: "_amount", type: "uint256", }, ], name: "mint", outputs: [], stateMutability: "nonpayable", type: "function", }, ], })

src/shared/artifacts/EternalRegistry.ts

EternalRegistry
Default value : Object.freeze({ address: "", abis: [ { inputs: [], name: "BaseRegistryAccessDenied", type: "error", }, { inputs: [], name: "BaseRegistryOperationNotPermitted", type: "error", }, { inputs: [], name: "EternalRegistryAttemptToSetARestrictedKey", type: "error", }, { inputs: [], name: "EternalRegistryBatchLengthMismatch", type: "error", }, { inputs: [], name: "EternalRegistryIndexShouldBeLessThanLengthOfTheArray", type: "error", }, { inputs: [], name: "InstrumentRegistryInstrumentAlreadyExists", type: "error", }, { inputs: [], name: "InstrumentRegistryNotExistingInstrument", type: "error", }, { inputs: [], name: "PermissionedContractAccessDenied", type: "error", }, { inputs: [], name: "QueueIsEmpty", type: "error", }, { inputs: [], name: "TimestampNotIncresing", type: "error", }, { inputs: [ { internalType: "bytes32[]", name: "_ids", type: "bytes32[]", }, { internalType: "bytes32[]", name: "_keys", type: "bytes32[]", }, { internalType: "bool[]", name: "_boolValues", type: "bool[]", }, { internalType: "uint256[]", name: "_uintValues", type: "uint256[]", }, { internalType: "address[]", name: "_addressValues", type: "address[]", }, { internalType: "string[]", name: "_stringValues", type: "string[]", }, { internalType: "bytes32[]", name: "_bytesValues", type: "bytes32[]", }, { internalType: "bytes32", name: "_senderRole", type: "bytes32", }, ], name: "setBatch", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "bytes32", name: "_instrumentId", type: "bytes32", }, { internalType: "bytes32", name: "_key", type: "bytes32", }, { internalType: "address", name: "_value", type: "address", }, { internalType: "bytes32", name: "_senderRole", type: "bytes32", }, ], name: "setAddress", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "bytes32", name: "_instrumentId", type: "bytes32", }, { internalType: "bytes32", name: "_key", type: "bytes32", }, { internalType: "address[]", name: "_value", type: "address[]", }, { internalType: "bytes32", name: "_senderRole", type: "bytes32", }, ], name: "setAddressArray", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "bytes32", name: "_instrumentId", type: "bytes32", }, { internalType: "bytes32", name: "_key", type: "bytes32", }, { internalType: "uint256", name: "index", type: "uint256", }, { internalType: "address", name: "_value", type: "address", }, { internalType: "bytes32", name: "_senderRole", type: "bytes32", }, ], name: "setAddressArrayIndexValue", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "bytes32", name: "_instrumentId", type: "bytes32", }, { internalType: "bytes32", name: "_key", type: "bytes32", }, { internalType: "bool", name: "_value", type: "bool", }, { internalType: "bytes32", name: "_senderRole", type: "bytes32", }, ], name: "setBool", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "bytes32", name: "_instrumentId", type: "bytes32", }, { internalType: "bytes32", name: "_key", type: "bytes32", }, { internalType: "bytes32", name: "_value", type: "bytes32", }, { internalType: "bytes32", name: "_senderRole", type: "bytes32", }, ], name: "setBytes", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "bytes32", name: "_instrumentId", type: "bytes32", }, { internalType: "bytes32", name: "_key", type: "bytes32", }, { internalType: "string", name: "_value", type: "string", }, { internalType: "bytes32", name: "_senderRole", type: "bytes32", }, ], name: "setString", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "bytes32", name: "_instrumentId", type: "bytes32", }, { internalType: "bytes32", name: "_key", type: "bytes32", }, { internalType: "uint256", name: "_value", type: "uint256", }, { internalType: "bytes32", name: "_senderRole", type: "bytes32", }, ], name: "setUint", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "bytes32", name: "_id", type: "bytes32", }, { internalType: "bytes32", name: "_key", type: "bytes32", }, ], name: "getUint", outputs: [ { internalType: "uint256", name: "", type: "uint256", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "bytes32", name: "_id", type: "bytes32", }, { internalType: "bytes32", name: "_key", type: "bytes32", }, ], name: "getBytes", outputs: [ { internalType: "bytes32", name: "", type: "bytes32", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "bytes32", name: "_id", type: "bytes32", }, { internalType: "bytes32", name: "_key", type: "bytes32", }, { internalType: "uint256", name: "_index", type: "uint256", }, ], name: "getAddressArrayIndexValue", outputs: [ { internalType: "address", name: "", type: "address", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "bytes32", name: "_id", type: "bytes32", }, { internalType: "bytes32", name: "_key", type: "bytes32", }, ], name: "getAddressArray", outputs: [ { internalType: "address[]", name: "", type: "address[]", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "bytes32", name: "_id", type: "bytes32", }, { internalType: "bytes32", name: "_key", type: "bytes32", }, ], name: "getAddress", outputs: [ { internalType: "address", name: "", type: "address", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "bytes32", name: "_id", type: "bytes32", }, { internalType: "bytes32", name: "_key", type: "bytes32", }, ], name: "getString", outputs: [ { internalType: "string", name: "", type: "string", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "bytes32", name: "_id", type: "bytes32", }, { internalType: "bytes32", name: "_key", type: "bytes32", }, ], name: "getBool", outputs: [ { internalType: "bool", name: "", type: "bool", }, ], stateMutability: "view", type: "function", }, ], })

src/common/provider/web3/eventListener.ts

eventListener
Default value : async ({ contractName, eventName, blockNumber, address, }: IEventListener): Promise<ethers.EventLog> => { const { abis } = getContractByName[ContractName[contractName]]; const contract = new ethers.Contract(address, abis, provider); const eventFilter: ethers.DeferredTopicFilter = contract.filters[eventName](); const [event] = (await contract.queryFilter( eventFilter, blockNumber, blockNumber, )) as ethers.EventLog[]; return event; }

src/shared/artifacts/FundRegistry.ts

FundRegistry
Default value : Object.freeze({ address: "0x15B65A15775Fa82268dCc310c4D09EcB425fDF52", abis: [ { inputs: [ { internalType: "bytes32", name: "_senderRole", type: "bytes32", }, { internalType: "bytes32", name: "fundId", type: "bytes32", }, ], name: "addNewFund", outputs: [], stateMutability: "nonpayable", type: "function", }, ], })

src/security/schemas/fund.schema.ts

FundSchema
Default value : SchemaFactory.createForClass(Fund)

src/common/provider/thegraph/queries/dealer.qgl.ts

geAllDealersQuery
Default value : gql` query getAllDealers { dealers { id wallets entryDate income worth isBlacklisted whitelistInfo { subscribedInstrument { id fund { id } } } } } `
getDealerTxsQuery
Default value : gql` query getDealerTxsQuery( $dealerId: String! $first: Int = 1000 $skip: Int = 0 $orderDirection: String = "desc" ) { dealer(id: $dealerId) { awaitingTxs( first: $first skip: $skip orderBy: lastTimeUpdated orderDirection: $orderDirection ) { id type status createTxHash confirmedTxHash amount submitterAddress onBehalf { id associatedDealer { id } } dealer { id } isDealer investorWallet beneficiary cancelTxHash lockedTxHash settledTxHash creationTime cancelTime confirmTime lockTime lastTimeUpdated orderBook { id type unconfirmedAmount confirmedAmount lockedAmount settledAmount instrument { id securityToken { id name symbol } } fund { id totalCurrentAmount totalPendingAmount totalSettledAmount } } } pendingTxs( first: $first skip: $skip orderBy: lastTimeUpdated orderDirection: $orderDirection ) { id type status createTxHash confirmedTxHash amount submitterAddress onBehalf { id associatedDealer { id } } dealer { id } isDealer investorWallet beneficiary cancelTxHash lockedTxHash settledTxHash creationTime cancelTime confirmTime lockTime lastTimeUpdated orderBook { id type unconfirmedAmount confirmedAmount lockedAmount settledAmount instrument { id securityToken { id name symbol } } fund { id totalCurrentAmount totalPendingAmount totalSettledAmount } } } } } `

test/fixture/generateAgreement.ts

generateAgreement
Default value : (investor: IUser) => { return { agreement: { emailSubject: "Docusign agreement for your order", receiverName: investor.name, receiverEmail: investor.email, fundId: (investor.subscribedFunds[0] as unknown as Fund)._id.toString(), htmlString: '<div><div style="padding-left:50px;padding-right:50px;margin-top:20px;background-color:white"><div style="padding-top:20px;font-weight:bold;text-align:center"><span>LIBRE GOLD FUND FEEDER FUND LIMITED</span></div><div style="font-weight:bold;margin-top:10px;text-align:center">SUBSCRIPTION DETAILS FORM</div><div><table style="border-collapse:collapse;width:100%;margin-top:20px"><tr><th style="border:1px solid black;padding:0px 10px">Investor ID</th><td style="width:50%;border:1px solid black;padding-left:10px">6481e2062ca9a042fac9d66b</td></tr><tr><th style="border:1px solid black;padding:0px 10px">Reference</th><td style="border:1px solid black;padding-left:10px">The important reference number</td></tr></table><table style="width:100%;margin-top:20px;border-collapse:collapse"><tr><th style="border:1px solid black;padding:0px 10px">Fund Name</th><th style="border:1px solid black;padding:0px 10px">Share Class</th><th style="border:1px solid black;padding:0px 10px">Currency</th><th style="border:1px solid black;padding:0px 10px">Amount</th></tr><tr style="height:25px"><td style="text-align:center;border:1px solid black">Gold Fund</td><td style="text-align:center;border:1px solid black">Gold Instrument</td><td style="text-align:center;border:1px solid black">USD</td><td style="text-align:center;border:1px solid black">1135.0</td></tr></table></div><div style="margin-top:20px"><div style="text-decoration:underline;font-size:16px;font-weight:bold">Important Notice</div><div style="margin-top:10px">This form, together with cleared funds must be received by no later than 4.00pm (GMT) on the business day falling at least 3 days before the relevant Subscription Deadline.</div></div><div style="margin-top:20px"><div style="text-decoration:underline;font-size:16px;font-weight:bold">Representations and Warranties</div><div style="margin-top:10px">The Applicant hereby acknowledges that he/she has received and carefully considered the current Supplement relating to the Fund and that the offer of Shares is subject to the terms and conditions contained in the Supplement and will not breach any applicable laws in his/her own jurisdiction.</div></div><div style="margin-top:20px"><div style="text-decoration:underline;font-size:16px;font-weight:bold">Bank Account Details</div><div style="margin-top:10px">The details of the Fund\'s bank accounts to which subscription amounts of each currency must be transferred are as follows:</div></div><div style="margin-top:20px"><div style="font-size:16px;font-weight:bold">US Dollar account details:</div><div style="margin-top:10px">Bank: The bank name</div><div>Address: The bank address</div><div>BIC: The account Bic</div><div style="display:flex;flex-direction:row"><div>Account Name: LIBRE The bank account name FEEDER FUND LIMITED</div></div><div>Account Number: Account number</div><div>Reference: The important reference number</div></div><div style="padding-bottom:50px;margin-top:30px"><div style="font-size:16px">PLEASE SIGN BELOW</div><div style="height:40px;margin-top:10px;display:flex;flex-direction:row;justify-content:space-between"><div style="height:40px;border:1px solid black;width:250px;padding:5px"><div></div><div></div></div><div><div style="height:40px;border:1px solid black;width:250px;padding:5px"><div>20/06/2023</div></div><div>Date</div></div></div></div></div></div>', }, }; }

test/fixture/generateUsers.ts

generateUser
Default value : (endUserRole: EndUserRoles) => { const email = `test_${endUserRole}_${(Math.random() + 1) .toString(36) .substring(7)}@test.com`; return endUserRole === "investor" ? { ...userDefaultData, ...InvestorOnChainFields, endUserRole, email, dealerId: "652d23ff44d65044899bdc67", } : { ...userDefaultData, endUserRole, email, }; }
InvestorOnChainFields
Type : object
Default value : { onChainFields: [ { name: "AML_PASSED", type: "Bool", value: "true", }, { name: "KYC_PASSED", type: "Bool", value: "true", }, { name: "SANCTIONS_PASSED", type: "Bool", value: "true", }, { name: "IS_FIT", type: "Bool", value: "true", }, { name: "SELF_CERTIFICATED", type: "Bool", value: "true", }, { name: "INVESTOR_TYPE", type: "Uint", value: "1", }, { name: "RESIDENT", type: "Uint", value: "826", }, { name: "REVIEW_DATE", type: "Uint", value: "1880790144", }, ], }
userDefaultData
Default value : Object.freeze({ password: "Password123$", subscribedFunds: ["652d21e0e8afdd89635f95e8"], name: "userrr", address: "12 Street Road, SW12 2HA", legalDocuments: S3File, bankName: "The bank name", bankAddress: "The bank address", bankChaps: "The bank chaps", bankBic: "The bank bic", accountNo: "Account number", accountBic: "The account Bic", accountName: "The bank account name", ibanNo: "The IBAN number", ultimateName: "Th ultimate name", ultimateAccountNo: "The ultimate account no ", currency: "USD", abaCode: "The aba code", cmsFields: [ { name: "Postal code", value: "11531", }, ], })

src/common/provider/thegraph/queries/orderbook.qgl.ts

getAllAdminSettledOrdersQuery
Default value : gql` query getAllSettledOrdersQuery( $first: Int = 1000 $skip: Int = 0 $orderDirection: String = "desc" ) { orders( where: { status: "Settled" } orderBy: "creationTime" orderDirection: $orderDirection first: $first skip: $skip ) { orderBook { id instrument { id } fund { id } } type amount settledOnNavPerShare settleTime settledTxHash onBehalf { id associatedDealer { id } } } } `
getAllDealerSettledOrdersQuery
Default value : gql` query getAllSettledOrdersQuery( $userId: String! $fundsId: [String]! $first: Int = 1000 $skip: Int = 0 $orderDirection: String = "desc" ) { orders( where: { dealer_contains: $userId, status: "Settled", fund_in: $fundsId } orderBy: "creationTime" orderDirection: $orderDirection first: $first skip: $skip ) { orderBook { id type instrument { id } fund { id } } type amount settledOnNavPerShare settleTime settledTxHash onBehalf { id associatedDealer { id } } } } `
getAllFundAdminSettledOrdersQuery
Default value : gql` query getAllFundAdminSettledOrdersQuery( $fundsId: [String]! $first: Int = 1000 $skip: Int = 0 $orderDirection: String = "desc" ) { orders( where: { status: "Settled", fund_in: $fundsId } orderBy: "creationTime" orderDirection: $orderDirection first: $first skip: $skip ) { orderBook { id type instrument { id } fund { id } } type amount settledOnNavPerShare settleTime settledTxHash onBehalf { id associatedDealer { id } } } } `
getAllInvestorSettledOrdersQuery
Default value : gql` query getAllSettledOrdersQuery( $userId: String! $fundsId: [String]! $first: Int = 1000 $skip: Int = 0 $orderDirection: String = "desc" ) { orders( where: { fund_in: $fundsId onBehalf_contains: $userId status: "Settled" } orderBy: "creationTime" first: $first skip: $skip orderDirection: $orderDirection ) { orderBook { id type instrument { id } fund { id } } type amount settledOnNavPerShare settleTime onBehalf { id associatedDealer { id } } } } `
getAllOrdersByAssociatedInvestorsQuery
Default value : gql` query getAllOrdersByInvestorIdQuery( $investorIds: [String!] $first: Int = 1000 $skip: Int = 0 $orderDirection: String = "desc" ) { orders( where: { onBehalf_in: $investorIds } orderBy: "creationTime" orderDirection: $orderDirection first: $first skip: $skip ) { id type status createTxHash confirmedTxHash amount submitterAddress onBehalf { id associatedDealer { id } } isDealer investorWallet beneficiary cancelTxHash lockedTxHash settledTxHash cancelTime confirmTime lockTime } } `
getAllOrdersByDealerIdQuery
Default value : gql` query getAllOrdersByDealerIdQuery( $dealerId: String! $type: String = "" $first: Int = 10 $skip: Int = 0 $status: String = "" $orderDirection: String = "desc" ) { orders( where: { dealer_contains: $dealerId type_contains: $type status_contains: $status } orderBy: "creationTime" orderDirection: $orderDirection first: $first skip: $skip ) { id type status createTxHash confirmedTxHash amount submitterAddress onBehalf { id associatedDealer { id } } dealer { id } isDealer investorWallet beneficiary cancelTxHash lockedTxHash settledTxHash creationTime cancelTime confirmTime lockTime lastTimeUpdated orderBook { id type unconfirmedAmount confirmedAmount lockedAmount settledAmount instrument { id securityToken { id name symbol } navs { navPerShare fiatCurrency timestamp isAudited } } fund { id totalCurrentAmount totalPendingAmount totalSettledAmount } } } } `
getAllOrdersByIdsQuery
Default value : gql` query getAllOrdersByTypeQuery( $orderIds: [String!] $status: String = "" $type: String = "" $orderDirection: String = "desc" ) { orders( where: { id_in: $orderIds type_contains: $type status_contains: $status } orderBy: "creationTime" orderDirection: $orderDirection ) { id type orderBook { id type instrument { id securityToken { id name symbol } navs { navPerShare fiatCurrency timestamp isAudited } } unconfirmedAmount confirmedAmount lockedAmount settledAmount fund { id totalCurrentAmount totalPendingAmount totalSettledAmount } } status createTxHash confirmedTxHash amount submitterAddress creationTime onBehalf { id associatedDealer { id } } isDealer investorWallet beneficiary cancelTxHash lockedTxHash settledTxHash cancelTime confirmTime lockTime lastTimeUpdated } } `
getAllOrdersByInstrumentIdQuery
Default value : gql` query getAllOrdersByDealerIdQuery( $instrumentId: String! $type: String! $first: Int = 1000 $skip: Int = 0 $orderDirection: String = "desc" ) { orders( where: { instrument: $instrumentId, type_contains: $type } orderBy: "creationTime" orderDirection: $orderDirection first: $first skip: $skip ) { id orderBook { id type unconfirmedAmount confirmedAmount lockedAmount settledAmount instrument { id securityToken { id name symbol } navs { navPerShare fiatCurrency timestamp isAudited } } fund { id totalCurrentAmount totalPendingAmount totalSettledAmount } } type status createTxHash confirmedTxHash amount submitterAddress onBehalf { id associatedDealer { id } } isDealer investorWallet beneficiary cancelTxHash lockedTxHash settledTxHash cancelTime confirmTime lockTime lastTimeUpdated } } `
getAllOrdersByInvestorIdQuery
Default value : gql` query getAllOrdersByInvestorIdQuery( $investorId: String! $type: String = "" $status: String = "" $first: Int = 1000 $skip: Int = 0 $orderDirection: String = "desc" ) { orders( where: { onBehalf: $investorId type_contains: $type status_contains: $status } orderBy: "creationTime" orderDirection: $orderDirection first: $first skip: $skip ) { id orderBook { id type unconfirmedAmount confirmedAmount lockedAmount settledAmount instrument { id securityToken { id name symbol } navs { navPerShare fiatCurrency timestamp isAudited } } fund { id totalCurrentAmount totalPendingAmount totalSettledAmount } } type status createTxHash confirmedTxHash amount submitterAddress onBehalf { id associatedDealer { id } } isDealer investorWallet beneficiary cancelTxHash lockedTxHash settledTxHash creationTime cancelTime confirmTime lockTime lastTimeUpdated } } `
getAllOrdersBySubscribedFundsIdQuery
Default value : gql` query getAllOrderBooksBySubscribedFundsIdQuery( $fundsId: [String]! $type: String = "" $first: Int = 1000 $skip: Int = 0 $orderDirection: String = "desc" ) { orders( where: { fund_in: $fundsId, type_contains: $type } orderBy: "creationTime" orderDirection: $orderDirection first: $first skip: $skip ) { id orderBook { id type unconfirmedAmount confirmedAmount lockedAmount settledAmount instrument { id securityToken { id name symbol } navs { navPerShare fiatCurrency timestamp isAudited } } fund { id totalCurrentAmount totalPendingAmount totalSettledAmount } } type status createTxHash confirmedTxHash amount submitterAddress onBehalf { id associatedDealer { id } } isDealer investorWallet beneficiary cancelTxHash lockedTxHash settledTxHash cancelTime confirmTime lockTime } } `
getAllOrdersByTypeQuery
Default value : gql` query getAllOrdersByTypeQuery( $type: String = "" $status: String = "" $stableCoinTokens: [String!] $first: Int = 1000 $skip: Int = 0 $orderDirection: String = "desc" ) { orders( where: { type_contains: $type, status_contains: $status } orderBy: "creationTime" orderDirection: $orderDirection first: $first skip: $skip ) { id type orderBook { id type instrument { id securityToken { id name symbol } navs { navPerShare fiatCurrency timestamp isAudited } } unconfirmedAmount confirmedAmount lockedAmount settledAmount fund { id totalCurrentAmount totalPendingAmount totalSettledAmount } } status createTxHash confirmedTxHash amount submitterAddress creationTime onBehalf { id associatedDealer { id } } isDealer investorWallet beneficiary cancelTxHash lockedTxHash settledTxHash cancelTime confirmTime lockTime lastTimeUpdated } } `
getAllSubscribersQuery
Default value : gql` query getAllSubscribersQuery($fundsId: [String]!, $type: String!) { orderBooks(where: { fund_in: $fundsId, type_contains: $type }) { id orders { onBehalf { id associatedDealer { id } } } } } `
getClosestOrdersToLockQuery
Default value : gql` query getOrderBookAddressByInstrumentQuery( $orderBook: String! $orderId: String! $actualId: Int = 0 ) { closestOrdersToLock: orders( where: { actualId_lt: $actualId, orderBook: $orderBook, status: "Locked" } first: 1 orderBy: id orderDirection: desc ) { actualId } orderBook(id: $orderBook) { id unconfirmedAmount confirmedAmount lockedAmount settledAmount instrument { id securityToken { id name symbol } } fund { id totalCurrentAmount totalPendingAmount totalSettledAmount } } order(id: $orderId) { onBehalf { id associatedDealer { id } } dealer { id } amount } } `
getDealerIdAndStatusByOrderIdQuery
Default value : gql` query getDealerIdAndStatusByOrderIdQuery($orderId: String!) { order(id: $orderId) { status dealer { id } onBehalf { id } } } `
getFundIdByOrderbookQuery
Default value : gql` query getOrderByIdQuery($orderBookId: String!) { getOrderByIdQuery: orderBook(id: $orderBookId) { fund { id } } } `
getLastSettledOrderIdQuery
Default value : gql` query getLastSettledOrderIdQuery($instrumentId: String!, $type: String!) { orderBooks(where: { instrument: $instrumentId, type: $type }) { id type fund { id } settledAmount instrument { securityToken { name symbol } navs(first: 1, orderBy: timestamp, orderDirection: desc) { navPerShare timestamp } } lockedOrders: orders(where: { status: "Locked" }) { amount id type status amount submitterAddress onBehalf { id associatedDealer { id } } dealer { id } instrument { id securityToken { id name symbol } } isDealer investorWallet beneficiary createTxHash confirmedTxHash cancelTxHash lockedTxHash settledTxHash cancelTime confirmTime lockTime } orders( where: { status: "Locked" } orderBy: actualId orderDirection: desc first: 1 ) { id } } } `
getLatestNavsByInstrumentsIdsQuery
Default value : gql` query getCurrentInvestorSettledOrdersQuery($ids: [String]!) { instruments(where: { id_in: $ids }) { id navs( where: { isAudited: true } orderBy: timestamp orderDirection: desc first: 1 ) { navPerShare fiatCurrency timestamp } } } `
getOrderAmountAndPaymentTokenByIdQuery
Default value : gql` query getOrderAmountAndPaymentTokenByIdQuery( $orderId: String! $orderbookAddress: String! $actualId: Int = 0 ) { order(id: $orderId) { amount id type status amount submitterAddress instrument { id securityToken { id name symbol } } fund { id totalCurrentAmount totalPendingAmount totalSettledAmount } onBehalf { id associatedDealer { id } } isDealer investorWallet beneficiary createTxHash confirmedTxHash cancelTxHash lockedTxHash settledTxHash cancelTime confirmTime lockTime } orderBook(id: $orderbookAddress) { id paymentTokenAsset { id } unconfirmedAmount confirmedAmount lockedAmount settledAmount instrument { id securityToken { id name symbol } } fund { id totalCurrentAmount totalPendingAmount totalSettledAmount } } closestOrdersToLock: orders( where: { actualId_lt: $actualId, status: "Locked" } first: 1 orderBy: id orderDirection: desc ) { actualId } } `
getOrderAmountAndSecurityTokenByIdQuery
Default value : gql` query getOrderAmountAndSecurityTokenByIdQuery( $orderId: String! $orderbookAddress: String! $actualId: Int = 0 ) { order(id: $orderId) { amount id type status amount submitterAddress onBehalf { id associatedDealer { id } } instrument { id securityToken { id name symbol } } isDealer investorWallet beneficiary createTxHash confirmedTxHash cancelTxHash lockedTxHash settledTxHash cancelTime confirmTime lockTime } orderBook(id: $orderbookAddress) { id asset { id } unconfirmedAmount confirmedAmount lockedAmount settledAmount instrument { id securityToken { id name symbol } } fund { id totalCurrentAmount totalPendingAmount totalSettledAmount } } closestOrdersToLock: orders( where: { actualId_lt: $actualId, status: "Locked" } first: 1 orderBy: id orderDirection: desc ) { actualId } } `
getOrderBookAddressByInstrumentQuery
Default value : gql` query getOrderBookAddressByInstrumentQuery( $actualId: Int = 0 $instrumentId: String! $type: String! ) { orderBooks(where: { instrument: $instrumentId, type_contains: $type }) { id unconfirmedAmount confirmedAmount lockedAmount settledAmount instrument { id securityToken { id name symbol } } fund { id totalCurrentAmount totalPendingAmount totalSettledAmount } lastOrders: orders( orderDirection: "desc" orderBy: "creationTime" first: 1 ) { actualId } closestOrdersToLock: orders( where: { actualId_lt: $actualId, status: "Locked" } first: 1 orderBy: id orderDirection: desc ) { actualId } } } `
getOrderBooksByFundIdsQuery
Default value : gql` query getOrderBooksByFundIdsQuery($fundIds: [String!]) { getOrderBooksByFundIdsQuery: orderBooks(fund_in: $fundIds) { id } } `
getOrderByIdQuery
Default value : gql` query getOrderByIdQuery( $orderBookId: String! $orderId: String! $onBehalf: String! $dealerId: String! ) { orderBook(id: $orderBookId) { id fund { id } instrument { id securityToken { id name symbol } } } orders( where: { id: $orderId onBehalf_contains: $onBehalf dealer_contains: $dealerId } ) { id type status createTxHash confirmedTxHash amount submitterAddress onBehalf { id associatedDealer { id } } isDealer investorWallet beneficiary cancelTxHash lockedTxHash settledTxHash cancelTime confirmTime lockTime } } `
getOrderDetailsQuery
Default value : gql` query getOrderByIdQuery($orderBook: String!, $orderId: String!) { orderBook(id: $orderBook) { id type fund { id } instrument { id securityToken { name symbol } } } order(id: $orderId) { id type fund { id } instrument { securityToken { name symbol } } amount onBehalf { id associatedDealer { id } } dealer { id } confirmedTxHash } } `

src/common/provider/thegraph/queries/investor.qgl.ts

getAllFundInstrumentsByFundIdAndInvestorIdQuery
Default value : gql` query getInvestorsIdByInstrumentQuery($fundId: String!, $userId: String!) { instruments(where: { fund: $fundId }) { id securityToken { name } } whitelistInfo(id: $userId) { subscribedInstrument { id securityToken { name } } } } `
getCurrentDealerIdQuery
Default value : gql` query getCurrentDealerQuery($investorId: String!) { investor(id: $investorId) { associatedDealer { id } } } `
getGroupOfInvestorsRegistryFieldsQuery
Default value : gql` query getGroupOfInvestorsWhitelistQuery( $ids: [String]! $contractAddress: String! ) { fieldsToLink: registryDataFields( where: { contractAddress: $contractAddress } first: 1000 ) { key } userFields: registryDataFields(where: { fieldId_in: $ids }, first: 1000) { fieldId key value type } } `
getInvestorFieldsQuery
Default value : gql` query getInvestorJurisdictionFields($ids: [String]!) { registryDataFields(where: { fieldId_in: $ids }) { fieldId key value } } `
getInvestorsByDealerIdQuery
Default value : gql` query getInvestorsByDealerIdQuery($id: String!) { investors(where: { associatedDealer: $id }) { id wallets entryDate income worth isBlacklisted whitelistInfo { subscribedInstrument { id fund { id } } } investorType isOnBoardedByAdmin } } `
getInvestorsIdByInstrumentQuery
Default value : gql` query getInvestorsIdByInstrumentQuery($instrumentId: String!) { instrument(id: $instrumentId) { id securityToken { name } fund { id } } whitelistInfos( where: { subscribedInstrument_contains_nocase: [$instrumentId] } ) { id unConfirmedRedeemedAmount } } `
getInvestorsQuery
Default value : gql` query getAllInvestors { investors { id wallets entryDate income worth isBlacklisted whitelistInfo { subscribedInstrument { id fund { id } } } investorType associatedDealer { id } isOnBoardedByAdmin } } `
getInvestorTxsByDealerIdQuery
Default value : gql` query getInvestorTxsByDealerIdQuery( $investorId: String! $dealerId: String! $first: Int = 1000 $skip: Int = 0 $orderDirection: String = "desc" ) { dealer(id: $dealerId) { awaitingTxs( where: { onBehalf: $investorId } first: $first skip: $skip orderBy: lastTimeUpdated orderDirection: $orderDirection ) { id type status createTxHash confirmedTxHash amount submitterAddress onBehalf { id associatedDealer { id } } dealer { id } isDealer investorWallet beneficiary cancelTxHash lockedTxHash settledTxHash creationTime cancelTime confirmTime lockTime lastTimeUpdated orderBook { id type unconfirmedAmount confirmedAmount lockedAmount settledAmount instrument { id securityToken { id name symbol } } fund { id totalCurrentAmount totalPendingAmount totalSettledAmount } } } pendingTxs( where: { onBehalf: $investorId } first: $first skip: $skip orderBy: lastTimeUpdated orderDirection: $orderDirection ) { id type status createTxHash confirmedTxHash amount submitterAddress onBehalf { id associatedDealer { id } } dealer { id } isDealer investorWallet beneficiary cancelTxHash lockedTxHash settledTxHash creationTime cancelTime confirmTime lockTime lastTimeUpdated orderBook { id type unconfirmedAmount confirmedAmount lockedAmount settledAmount instrument { id securityToken { id name symbol } } fund { id totalCurrentAmount totalPendingAmount totalSettledAmount } } } } } `
getInvestorWhitelistQuery
Default value : gql` query getInvestorWhitelistQuery($id: String!) { whitelistInfo(id: $id) { id investorType isAml isKyced isSanctions location subscribedInstrument { id } jurisdiction { isFitnessTestRequired isSelfCertificationRequired disclosureLevel isListedOnRegulatedVenusRequired isLocalAIFMRequired isLocalNonEuAIFMRequired isMinimumInvestmentRequired numberOfMinimumInvestmentsHolding } } } `
getUserInstrumentBalanceQuery
Default value : gql` query getInvestorsIdByInstrumentQuery( $instrumentId: String! $investorId: String! ) { instrument(id: $instrumentId) { id securityToken { id name symbol } fund { id } navs(orderBy: timestamp, orderDirection: desc, first: 1) { navPerShare timestamp } } whitelistInfo(id: $investorId) { unConfirmedRedeemedAmount } } `

src/common/provider/thegraph/queries/users.qgl.ts

getAllUsersQuery
Default value : gql` query getAllUsers { dealers { id wallets entryDate income worth isBlacklisted whitelistInfo { subscribedInstrument { id fund { id } } } } investors { id wallets entryDate income worth isBlacklisted whitelistInfo { subscribedInstrument { id fund { id } } } investorType associatedDealer { id } isOnBoardedByAdmin } } `

src/common/provider/web3/web3Provider.ts

getContractByName
Type : Record<ContractName, literal type>
Default value : Object.freeze({ [ContractName.erc20]: { abis: ERC20.abis, address: "" }, [ContractName.DealerRegistry]: { abis: DealerRegistry.abis, address: DealerRegistry.address, }, [ContractName.InvestorRegistry]: { abis: InvestorRegistry.abis, address: InvestorRegistry.address, }, [ContractName.SubscriptionBook]: { abis: OrderBook.abis, address: OrderBook.address, }, [ContractName.RedemptionBook]: { abis: OrderBook.abis, address: OrderBook.address, }, [ContractName.FundRegistry]: { abis: FundRegistry.abis, address: FundRegistry.address, }, [ContractName.InstrumentRegistry]: { abis: InstrumentRegistry.abis, address: InstrumentRegistry.address, }, [ContractName.EternalRegistry]: { abis: EternalRegistry.abis, address: EternalRegistry.address, }, [ContractName.RoleRegistry]: { abis: RoleRegistry.abis, address: RoleRegistry.address, }, [ContractName.DealerRulesEngine]: { abis: DealerRulesEngine.abis, address: DealerRulesEngine.address, }, [ContractName.JurisdictionRegistry]: { abis: EternalRegistry.abis, // EternalRegistry and JurisdictionRegistry use the same abi address: JurisdictionRegistry.address, }, [ContractName.RulesEngine]: { abis: RulesEngine.abis, address: RulesEngine.address, }, })
getRoleAndContractAddressByNameOrAddress
Default value : async ({ userAddress, transactionName, contractName, contractAddress, }: IGetRoleAndContractAddressByNameOrAddress) => { try { if (!contractName && !contractAddress) { throw new BadRequestException("No address provided"); } const selector = getTxSelector({ contractName, transactionName }); const currentContractAddress = contractAddress || getContractByName[contractName].address; const role = await getRoleByContractAddress({ userAddress, selector, contractAddress: currentContractAddress, }); return { contractAddress: currentContractAddress, role, }; } catch (error) { console.error(error); if (error.code === 401) { throw new BadRequestException("No address provided"); } throw new ServiceUnavailableException(error); } }
provider
Default value : new ethers.JsonRpcProvider(process.env.RPC_URL)

src/common/utils/getFundName.ts

getFundName
Default value : (user: User, fundIdBytes: string) => { const decodedFundId = decodeBytes32String(fundIdBytes); return user.subscribedFunds.find( (fund) => fund._id.toString() === decodedFundId, )?.title; }

src/common/provider/thegraph/queries/instrument.qgl.ts

getInstrumentByIdQuery
Default value : gql` query ($instrumentId: String!) { instrument(id: $instrumentId) { id fund { totalConfirmedAmount totalCurrentAmount totalPendingAmount totalSettledAmount } securityToken { id name symbol } navs(orderBy: timestamp, orderDirection: desc) { id isAudited fiatCurrency navPerShare timestamp } minCapacity maxCapacity dealerBidLimit rulesEngineAddress redemption { startDate endDate frequency frequencyUnit numbOfPhases minCap maxCap cutOffTime cutOffUnit } subscription { startDate endDate frequency frequencyUnit numbOfPhases minCap maxCap cutOffTime cutOffUnit } lookBackTimestamp lookBackUnit topUpUnit masterFundHolding investorMinSubsequentHolding deposits cumulativePeriod cumulativePeriodUnit cumulativeRedemptionLimitFee cumulativeRedemptionLimitAllowance cumulativeRedemptionLimitPerInvestorAllowance cumulativeRedemptionLimitPerInvestorFee gateCriteriaThree initialRestrictedPeriod initialSubscriptionRestrictedPeriod initialSubscriptionRestrictedPeriodUnit initialSubscriptionRestrictedPeriodAllowance initialSubscriptionRestrictedPeriodFee initialRestrictedPeriodAllowance postSubscriptionRestrictedPeriodAllowance postSubscriptionRestrictedPeriodFee initialRestrictedPeriodFee postRestrictedPeriodAllowance postRestrictedPeriodFee isInvestorAllowListRequired noticePeriod noticePeriodUnit investmentSize minSubInvestment maximumBiddingAmount maximumBiddingQueueSize gateCriteriaOne volumeLimit } } `
getInstrumentsByFundQuery
Default value : gql` query ( $userId: String = "" $fundId: String! $first: Int = 1000 $skip: Int = 0 $orderDirection: String = "desc" ) { instruments( where: { fund: $fundId } orderBy: "creationTime" orderDirection: $orderDirection first: $first skip: $skip ) { id fund { totalConfirmedAmount totalCurrentAmount totalPendingAmount totalSettledAmount } securityToken { id name symbol } minCapacity maxCapacity dealerBidLimit rulesEngineAddress redemption { startDate endDate frequency frequencyUnit numbOfPhases minCap maxCap cutOffTime cutOffUnit } subscription { startDate endDate frequency frequencyUnit numbOfPhases minCap maxCap cutOffTime cutOffUnit } lookBackTimestamp lookBackUnit topUpUnit masterFundHolding investorMinSubsequentHolding deposits cumulativePeriod cumulativePeriodUnit cumulativeRedemptionLimitFee cumulativeRedemptionLimitAllowance cumulativeRedemptionLimitPerInvestorAllowance cumulativeRedemptionLimitPerInvestorFee gateCriteriaThree initialRestrictedPeriod initialSubscriptionRestrictedPeriod initialSubscriptionRestrictedPeriodUnit initialSubscriptionRestrictedPeriodAllowance initialSubscriptionRestrictedPeriodFee initialRestrictedPeriodAllowance postSubscriptionRestrictedPeriodAllowance postSubscriptionRestrictedPeriodFee initialRestrictedPeriodFee postRestrictedPeriodAllowance postRestrictedPeriodFee isInvestorAllowListRequired noticePeriod noticePeriodUnit investmentSize minSubInvestment maximumBiddingAmount maximumBiddingQueueSize gateCriteriaOne volumeLimit navs(orderBy: timestamp, orderDirection: desc) { id isAudited fiatCurrency navPerShare timestamp } } whitelistInfo(id: $userId) { subscribedInstrument { id } } dealerSettlements: orders( where: { dealer_contains: $userId, status: "Settled", fund: $fundId } orderBy: "creationTime" orderDirection: $orderDirection first: $first skip: $skip ) { orderBook { id type instrument { id } fund { id } } type amount settledOnNavPerShare settleTime settledTxHash onBehalf { id associatedDealer { id } } } investorSettlements: settlements( where: { fundId: $fundId, investorId: $userId } ) { type investorId instrument { id } settledOrder { amount } } } `
getInstrumentStAddressQuery
Default value : gql` query ($instrumentId: String!) { instruments(where: { id: $instrumentId }) { securityToken { id } } } `
getNavsByInstrumentId
Default value : gql` query getNavsByInstrumentId($instrumentId: String!) { navs(where: { instrumentId: $instrumentId }) { id fiatCurrency isAudited timestamp navPerShare } } `

src/common/provider/thegraph/queries/roles-registry.qgl.ts

getRegistryDataFieldsQuery
Default value : gql` query getRegistryDataFieldsQuery($id: String!) { registryDataFields(where: { fieldId: $id }) { type key value } } `
getRoleByContractAddressQuery
Default value : gql` query getRoleByContractAddressQuery( $contractAddress: String! $userAddress: String! $selector: String! ) { contractManager: roles( where: { contractsAddresses_contains: [$contractAddress] } ) { id } selectors: roles( where: { addresses_contains: [$userAddress] selectors_contains: [$selector] } ) { id } } `

src/common/provider/thegraph/utils/getRoleByContractAddress.ts

getRoleByContractAddress
Default value : async ({ userAddress, contractAddress, selector, }: IGetRoleByContractAddress): Promise<string> => { const roleGraph: ApolloQueryResult<IGetRoleByContractAddressQuery> = await apolloClient.query({ query: getRoleByContractAddressQuery, variables: { userAddress, contractAddress, selector }, }); let role: string = Roles.Admin; if (roleGraph.data.selectors.length > 0) { role = roleGraph.data.selectors[0].id; } else if (roleGraph.data.contractManager.length > 0) { role = roleGraph.data.contractManager[0].id; } return role; }

src/common/provider/web3/getTxSelector.ts

getTxSelector
Default value : ({ transactionName, contractName, }: IGetTxSelector) => { const iface = new Interface(getContractByName[contractName].abis); return iface.getFunction(transactionName).selector; }

src/common/utils/cmsFieldsUploader.ts

getUserWithUnSignedUrl
Default value : async (user: User) => { const s3Service = new S3Service(); const cmsFields = await Promise.all( user.cmsFields.map(async (cmsField) => { if (cmsField.value.toString().includes("cmsCustomFile-")) { const value = await s3Service.getFileByKey(cmsField.value.toString()); return { ...cmsField, value, }; } return cmsField; }), ); if (!user.legalDocuments) { return { ...user, cmsFields }; } const legalDocuments = await s3Service.getFileByKey(user.legalDocuments); const userWithSignedUrls: User = { ...user, legalDocuments, cmsFields, }; return userWithSignedUrls; }
uploadCmsFileFields
Default value : async ( cmsFields: CmsFieldDTO[], ): Promise<ICmsField[]> => { const s3Service = new S3Service(); return await Promise.all( cmsFields.map(async (cmsField) => { // as cmsField.value instanceof FileDTO not working // We check all required properties for FileDTO if ( typeof cmsField.value === "object" && "originalname" in cmsField.value && "fileType" in cmsField.value && "base64String" in cmsField.value ) { const value = await s3Service.upload( cmsField.value as FileDTO, `cmsCustomFile-${cmsField.name}-${new Date().getTime()}.${ (cmsField.value as FileDTO).originalname.split(".")[1] }`, ); return { ...cmsField, value }; } return cmsField; }), ); }

src/shared/artifacts/InstrumentRegistry.ts

InstrumentRegistry
Default value : Object.freeze({ address: "0x674AE43435966a74a257722fEd2D207CafF57698", abis: [ { inputs: [], name: "BaseRegistryAccessDenied", type: "error", }, { inputs: [], name: "BaseRegistryOperationNotPermitted", type: "error", }, { inputs: [], name: "EternalRegistryAttemptToSetARestrictedKey", type: "error", }, { inputs: [], name: "EternalRegistryBatchLengthMismatch", type: "error", }, { inputs: [], name: "EternalRegistryIndexShouldBeLessThanLengthOfTheArray", type: "error", }, { inputs: [], name: "InstrumentRegistryInstrumentAlreadyExists", type: "error", }, { inputs: [], name: "InstrumentRegistryNotExistingInstrument", type: "error", }, { inputs: [], name: "QueueIsEmpty", type: "error", }, { inputs: [], name: "TimestampNotIncresing", type: "error", }, { inputs: [ { components: [ { internalType: "bytes32", name: "senderRole", type: "bytes32", }, { internalType: "bytes32", name: "instrumentId", type: "bytes32", }, { internalType: "uint256", name: "lookBackPeriod", type: "uint256", }, { internalType: "uint256", name: "lookBackPeriodUnit", type: "uint256", }, { internalType: "uint256", name: "topUpPeriod", type: "uint256", }, { internalType: "uint256", name: "topUpUnit", type: "uint256", }, { internalType: "uint256", name: "masterFundMinHolding", type: "uint256", }, { internalType: "uint256", name: "feederFundMinHolding", type: "uint256", }, { internalType: "uint256", name: "investorMinHolding", type: "uint256", }, { internalType: "uint256", name: "investorMinSubsequentHolding", type: "uint256", }, { internalType: "uint256", name: "cutiffTime", type: "uint256", }, { internalType: "uint256", name: "noticePeriod", type: "uint256", }, { internalType: "uint256", name: "noticePeriodUnit", type: "uint256", }, ], internalType: "struct IInstrumentRegistry.GlobalInstrumentConfig", name: "_globalInstrumentConfig", type: "tuple", }, ], name: "setUpGlobalConfig", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { components: [ { internalType: "bytes32", name: "senderRole", type: "bytes32", }, { internalType: "bytes32", name: "instrumentId", type: "bytes32", }, { internalType: "uint256", name: "startDate", type: "uint256", }, { internalType: "uint256", name: "endDate", type: "uint256", }, { internalType: "uint256", name: "frequency", type: "uint256", }, { internalType: "uint256", name: "frequencyUnit", type: "uint256", }, { internalType: "uint256", name: "numbOfPhases", type: "uint256", }, ], internalType: "struct IInstrumentRegistry.Offering", name: "_offering", type: "tuple", }, ], name: "setUpRedemption", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { components: [ { internalType: "bytes32", name: "senderRole", type: "bytes32", }, { internalType: "bytes32", name: "instrumentId", type: "bytes32", }, { internalType: "uint256", name: "startDate", type: "uint256", }, { internalType: "uint256", name: "endDate", type: "uint256", }, { internalType: "uint256", name: "frequency", type: "uint256", }, { internalType: "uint256", name: "frequencyUnit", type: "uint256", }, { internalType: "uint256", name: "numbOfPhases", type: "uint256", }, ], internalType: "struct IInstrumentRegistry.Offering", name: "_offering", type: "tuple", }, ], name: "setUpSubscription", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "bytes32", name: "_senderRole", type: "bytes32", }, { internalType: "bytes32", name: "_instrumentId", type: "bytes32", }, { internalType: "bytes32", name: "_dealerId", type: "bytes32", }, ], name: "addDealerToWhitelist", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "bytes32", name: "_senderRole", type: "bytes32", }, { internalType: "bytes32", name: "_instrumentId", type: "bytes32", }, { internalType: "bytes32", name: "_fundId", type: "bytes32", }, ], name: "addInstrument", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "bytes32", name: "_senderRole", type: "bytes32", }, { internalType: "bytes32", name: "_instrumentId", type: "bytes32", }, { internalType: "uint256", name: "_newNavPerShare", type: "uint256", }, ], name: "updateAuditedNavPerShare", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "bytes32", name: "_senderRole", type: "bytes32", }, { internalType: "bytes32", name: "_instrumentId", type: "bytes32", }, { internalType: "uint256", name: "_newNavPerShare", type: "uint256", }, ], name: "updateUnauditedNavPerShare", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "bytes32", name: "_instrumentId", type: "bytes32", }, { internalType: "bytes32", name: "_key", type: "bytes32", }, { internalType: "uint256", name: "_value", type: "uint256", }, { internalType: "bytes32", name: "_senderRole", type: "bytes32", }, ], name: "setUint", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "bytes32", name: "_senderRole", type: "bytes32", }, { internalType: "bytes32", name: "_instrumentId", type: "bytes32", }, { internalType: "address", name: "_paymentToken", type: "address", }, { internalType: "address", name: "_rulesEngine", type: "address", }, { internalType: "string", name: "_name", type: "string", }, { internalType: "string", name: "_symbol", type: "string", }, { internalType: "address", name: "_subscriptionBookImp", type: "address", }, { internalType: "address", name: "_redemptionBookImp", type: "address", }, { internalType: "address", name: "_stTokenImpl", type: "address", }, { internalType: "address", name: "_treasury", type: "address", }, ], name: "initializeInstrument", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "bytes32", name: "_instrumentId", type: "bytes32", }, { internalType: "bytes32", name: "_investorId", type: "bytes32", }, { internalType: "bool", name: "_allowed", type: "bool", }, { internalType: "bytes32", name: "_senderRole", type: "bytes32", }, ], name: "allowInvestor", outputs: [], stateMutability: "nonpayable", type: "function", }, ], })

src/security/schemas/instrument.schema.ts

InstrumentSchema
Default value : SchemaFactory.createForClass(Instrument)

src/shared/artifacts/investorRegistry.ts

InvestorRegistry
Default value : Object.freeze({ address: "0xdF40141Ea83D30453011fd3ca09d015590CC281C", abis: [ ...EternalRegistry.abis, { inputs: [], name: "BaseRegistryAccessDenied", type: "error", }, { inputs: [], name: "EternalRegistryAttemptToSetARestrictedKey", type: "error", }, { inputs: [], name: "EternalRegistryBatchLengthMismatch", type: "error", }, { inputs: [], name: "EternalRegistryIndexShouldBeLessThanLengthOfTheArray", type: "error", }, { inputs: [], name: "InvestorRegistryAlreadyAnInvestor", type: "error", }, { inputs: [], name: "InvestorRegistryNotAnInvestor", type: "error", }, { inputs: [], name: "InvestorRegistryNotDealerRulesEngine", type: "error", }, { inputs: [], name: "InvestorRegistryNotInvestorsDealer", type: "error", }, { inputs: [], name: "InvestorRegistryNotJurisdictionRegistry", type: "error", }, { inputs: [], name: "InvestorRegistryNotRulesEngine", type: "error", }, { inputs: [], name: "InvestorRegistryOperationNotPermitted", type: "error", }, { inputs: [], name: "InvestorRegistryWalletIsClaimedBySomeoneElse", type: "error", }, { inputs: [], name: "PermissionedContractAccessDenied", type: "error", }, { inputs: [ { internalType: "bytes32", name: "_senderRole", type: "bytes32", }, { internalType: "bytes32", name: "_investorId", type: "bytes32", }, { internalType: "bytes32", name: "_instrumentId", type: "bytes32", }, { internalType: "bool", name: "_restrict", type: "bool", }, ], name: "setInvestorRestriction", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [], name: "resetCheckedSinceJurisdictionUpdate", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "bytes32", name: "_senderRole", type: "bytes32", }, { internalType: "bytes32", name: "_investorId", type: "bytes32", }, { internalType: "address", name: "_wallet", type: "address", }, { internalType: "bytes32", name: "_dealerId", type: "bytes32", }, ], name: "addInvestor", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "address", name: "wallet", type: "address", }, ], name: "addWallet", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "bytes32", name: "_senderRole", type: "bytes32", }, { internalType: "bytes32", name: "investorId", type: "bytes32", }, { internalType: "bytes32", name: "newDealerId", type: "bytes32", }, ], name: "assignInvestorToNewDealer", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "bytes32", name: "_investorId", type: "bytes32", }, { internalType: "bytes32", name: "_instrumentId", type: "bytes32", }, ], name: "checkInvestorAllowed", outputs: [], stateMutability: "nonpayable", type: "function", }, ], })

src/common/constants/isoCode.ts

ISO_CODE
Default value : Object.freeze([ 4, 8, 10, 12, 16, 20, 24, 28, 31, 32, 36, 40, 44, 48, 50, 51, 52, 56, 60, 64, 68, 70, 72, 74, 76, 84, 86, 90, 92, 96, 100, 104, 108, 112, 116, 120, 124, 132, 136, 140, 144, 148, 152, 156, 158, 162, 166, 170, 174, 175, 178, 180, 184, 188, 191, 192, 196, 203, 204, 208, 212, 214, 218, 222, 226, 231, 232, 233, 234, 238, 239, 242, 246, 248, 250, 254, 258, 260, 262, 266, 270, 275, 276, 288, 292, 296, 300, 304, 308, 312, 316, 320, 324, 328, 332, 334, 336, 340, 344, 348, 352, 356, 360, 364, 368, 372, 376, 380, 384, 388, 392, 398, 400, 404, 408, 410, 414, 417, 418, 422, 426, 428, 430, 434, 438, 440, 442, 446, 450, 454, 458, 462, 466, 470, 474, 478, 480, 484, 492, 496, 498, 499, 500, 504, 508, 512, 516, 520, 524, 528, 531, 532, 533, 534, 535, 540, 548, 554, 558, 562, 566, 570, 574, 578, 580, 581, 583, 584, 585, 586, 591, 598, 600, 604, 608, 612, 616, 620, 624, 626, 630, 634, 638, 642, 643, 646, 652, 654, 659, 660, 662, 663, 666, 670, 674, 678, 682, 686, 688, 690, 694, 702, 703, 704, 705, 706, 710, 716, 724, 728, 729, 732, 740, 744, 748, 752, 756, 760, 762, 764, 768, 772, 776, 780, 784, 788, 792, 795, 796, 798, 800, 804, 807, 818, 826, 831, 832, 833, 834, 840, 850, 854, 858, 860, 862, 876, 882, 887, 894, ])

src/shared/artifacts/JurisdictionRegistry.ts

JurisdictionRegistry
Default value : Object.freeze({ address: "0x4D937dbA57F3228F3061994B5AFA24F924160Dc1", abis: [], // Same abi EternalRegistry })

src/common/utils/mergeCmsFields.ts

mergeCmsFields
Default value : (oldCmsFields, newCmsFeilds) => { // Create a map to store values by name const mergedMap = new Map(); // Populate the map with values from arrayA oldCmsFields.forEach((item) => { mergedMap.set(item.name, item.value); }); // Update values from arrayB, if the name already exists in the map newCmsFeilds.forEach((item) => { mergedMap.set(item.name, item.value); }); // Create a new array using the merged values from the map const mergedArray = Array.from(mergedMap, ([name, value]) => ({ name, value, })); return mergedArray; }

test/constants/MockService.ts

mockState1
Type : MockState
Default value : { name: "Mani", age: 25, place: "Hyderabad", address: "0x987654321", phone: "987654321", }
mockState2
Type : MockState
Default value : { name: "Chandra", age: 24, place: "Boston", address: "0x123456789", phone: "123456789", }
mockState3
Type : MockState
Default value : { name: "John", age: 20, place: "London", address: "0x123456789", phone: "123456789", }

src/module-manager/schemas/ModuleManager.schema.ts

ModuleManagerSchema
Default value : SchemaFactory.createForClass(ModuleManager)

src/security/schemas/nav.schema.ts

NavSchema
Default value : SchemaFactory.createForClass(Nav)

src/shared/onchainDataFields/schemas/onchainDataFeild.schema.ts

OnChainDataFieldSchema
Default value : SchemaFactory.createForClass(OnChainDataField)

src/common/utils/addOneHourToStringDate.ts

oneHourToStringDate
Default value : ( date: string, iSubtract: boolean, ): string => { // Parse the date string into a Date object const originalDate = new Date(date); const oneHour = iSubtract ? -1 * 60 * 60 * 1000 : 60 * 60 * 1000; // Add one hour to the Date object const newDate = new Date(originalDate.getTime() + oneHour); // 60 minutes * 60 seconds * 1000 milliseconds // Convert the updated Date object back to a string in the same format return newDate.toISOString(); }

src/common/provider/mail/templates/OrderApproved.ts

OrderApprovedTemplate
Default value : ({ orderType, txHashUrl, amount, fundName, instrumentName, txTime, }: IOrderApprovedTemplate) => { const message = `<a href="${txHashUrl}"> ${orderType} order </a> has been approved for the amount ${amount} in ${fundName} with instrument ${instrumentName}.\n Order was approved on ${txTime}.`; const email = addMessageToTemplate({ message, fundName, }); return email; }

src/common/provider/mail/templates/OrderArchived.ts

OrderArchivedTemplate
Default value : ({ orderType, txHashUrl, amount, fundName, instrumentName, txTime, }: IOrderArchivedTemplate) => { const message = `<a href="${txHashUrl}"> ${orderType} order </a> has been archived for the amount ${amount} in ${fundName} with instrument ${instrumentName}.\n Order was archived on ${txTime}.`; const email = addMessageToTemplate({ message, fundName, }); return email; }

src/shared/artifacts/OrderBook.ts

OrderBook
Default value : Object.freeze({ address: "", abis: [ { inputs: [ { internalType: "address", name: "spender", type: "address", }, { internalType: "uint256", name: "allowance", type: "uint256", }, { internalType: "uint256", name: "needed", type: "uint256", }, ], name: "ERC20InsufficientAllowance", type: "error", }, { inputs: [ { internalType: "address", name: "sender", type: "address", }, { internalType: "uint256", name: "balance", type: "uint256", }, { internalType: "uint256", name: "needed", type: "uint256", }, ], name: "ERC20InsufficientBalance", type: "error", }, { inputs: [ { internalType: "address", name: "approver", type: "address", }, ], name: "ERC20InvalidApprover", type: "error", }, { inputs: [ { internalType: "address", name: "receiver", type: "address", }, ], name: "ERC20InvalidReceiver", type: "error", }, { inputs: [ { internalType: "address", name: "sender", type: "address", }, ], name: "ERC20InvalidSender", type: "error", }, { inputs: [ { internalType: "address", name: "spender", type: "address", }, ], name: "ERC20InvalidSpender", type: "error", }, { inputs: [], name: "ERC1167FailedCreateClone", type: "error", }, { inputs: [], name: "AlreadyInitialized", type: "error", }, { inputs: [], name: "BaseRegistryAccessDenied", type: "error", }, { inputs: [], name: "BaseRegistryNotAValidId", type: "error", }, { inputs: [], name: "BaseUserRegistryWalletAlreadyClaimed", type: "error", }, { inputs: [], name: "BaseUserRegistryWalletOwnershipVerificationFailure", type: "error", }, { inputs: [], name: "BaseUserRegistryWalletSignatureExpired", type: "error", }, { inputs: [], name: "ECDSAInvalidSignature", type: "error", }, { inputs: [ { internalType: "uint256", name: "length", type: "uint256", }, ], name: "ECDSAInvalidSignatureLength", type: "error", }, { inputs: [], name: "AlreadyInitialized", type: "error", }, { inputs: [], name: "BaseRegistryAccessDenied", type: "error", }, { inputs: [], name: "BaseRegistryNotAValidId", type: "error", }, { inputs: [], name: "EternalRegistryAttemptToSetARestrictedKey", type: "error", }, { inputs: [], name: "EternalRegistryBatchLengthMismatch", type: "error", }, { inputs: [], name: "EternalRegistryIndexShouldBeLessThanLengthOfTheArray", type: "error", }, { inputs: [], name: "NotInitializing", type: "error", }, { inputs: [], name: "PermissionedContractAccessDenied", type: "error", }, { inputs: [ { internalType: "address", name: "target", type: "address", }, ], name: "AddressEmptyCode", type: "error", }, { inputs: [ { internalType: "address", name: "account", type: "address", }, ], name: "AddressInsufficientBalance", type: "error", }, { inputs: [], name: "FailedInnerCall", type: "error", }, { inputs: [ { internalType: "address", name: "target", type: "address", }, ], name: "AddressEmptyCode", type: "error", }, { inputs: [ { internalType: "address", name: "account", type: "address", }, ], name: "AddressInsufficientBalance", type: "error", }, { inputs: [], name: "FailedInnerCall", type: "error", }, { inputs: [], name: "AccessControlBadConfirmation", type: "error", }, { inputs: [ { internalType: "address", name: "account", type: "address", }, { internalType: "bytes32", name: "neededRole", type: "bytes32", }, ], name: "AccessControlUnauthorizedAccount", type: "error", }, { inputs: [], name: "IOrderPipelineBeneficiaryIsNotInvestor", type: "error", }, { inputs: [], name: "IOrderPipelineInsufficientAmount", type: "error", }, { inputs: [], name: "IOrderPipelineOrderAlreadySettledInCurrentRound", type: "error", }, { inputs: [], name: "IOrderPipelineOrderCannotBeConfirmed", type: "error", }, { inputs: [], name: "IOrderPipelineOrderNotFound", type: "error", }, { inputs: [], name: "IOrderPipelineOrderNotLocked", type: "error", }, { inputs: [], name: "IOrderPipelinePaymentTokenTransferFailed", type: "error", }, { inputs: [], name: "IOrderPipelinePercentageNotApt", type: "error", }, { inputs: [], name: "IOrderPipelineUnauthorized", type: "error", }, { inputs: [], name: "IOrderPipelineWrongInvestor", type: "error", }, { inputs: [ { internalType: "address", name: "target", type: "address", }, ], name: "AddressEmptyCode", type: "error", }, { inputs: [ { internalType: "address", name: "account", type: "address", }, ], name: "AddressInsufficientBalance", type: "error", }, { inputs: [], name: "AlreadyInitialized", type: "error", }, { inputs: [], name: "FailedInnerCall", type: "error", }, { inputs: [], name: "IOrderPipelineBeneficiaryIsNotInvestor", type: "error", }, { inputs: [], name: "IOrderPipelineInsufficientAmount", type: "error", }, { inputs: [], name: "IOrderPipelineOrderAlreadySettledInCurrentRound", type: "error", }, { inputs: [], name: "IOrderPipelineOrderNotFound", type: "error", }, { inputs: [], name: "IOrderPipelineOrderNotLocked", type: "error", }, { inputs: [], name: "IOrderPipelinePercentageNotApt", type: "error", }, { inputs: [], name: "IOrderPipelineUnauthorized", type: "error", }, { inputs: [], name: "IOrderPipelineWrongInvestor", type: "error", }, { inputs: [], name: "NotInitializing", type: "error", }, { inputs: [], name: "PermissionedContractAccessDenied", type: "error", }, { inputs: [], name: "IOrderPipelineBeneficiaryIsNotInvestor", type: "error", }, { inputs: [], name: "IOrderPipelineInsufficientAmount", type: "error", }, { inputs: [], name: "IOrderPipelineOrderAlreadySettledInCurrentRound", type: "error", }, { inputs: [], name: "IOrderPipelineOrderCannotBeLock", type: "error", }, { anonymous: false, inputs: [ { indexed: false, internalType: "uint256", name: "orderId", type: "uint256", }, { indexed: false, internalType: "bytes32", name: "investorId", type: "bytes32", }, { indexed: false, internalType: "uint256", name: "amount", type: "uint256", }, { indexed: false, internalType: "address", name: "beneficiary", type: "address", }, { indexed: false, internalType: "uint256", name: "submitter", type: "uint256", }, ], name: "OrderCreated", type: "event", }, { inputs: [ { internalType: "uint256", name: "_lastOrderToRebalance", type: "uint256", }, { internalType: "bytes32", name: "_role", type: "bytes32", }, ], name: "rebalanceSettlements", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "uint256", name: "_orderId", type: "uint256", }, ], name: "dealerCancelOrder", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "uint256", name: "_orderId", type: "uint256", }, ], stateMutability: "nonpayable", outputs: [], type: "function", name: "investorCancelOrder", }, { inputs: [ { internalType: "uint256", name: "_orderId", type: "uint256", }, { internalType: "bytes32", name: "_role", type: "bytes32", }, ], name: "adminCancelOrder", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "uint256", name: "_lastOrderId", type: "uint256", }, { internalType: "uint256", name: "_percentageToSettle", type: "uint256", }, { internalType: "bytes32", name: "_role", type: "bytes32", }, ], name: "settleOrders", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "bytes32", name: "_investorId", type: "bytes32", }, { internalType: "bytes32", name: "_role", type: "bytes32", }, ], name: "adminForceRedemption", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "bytes32", name: "_role", type: "bytes32", }, { internalType: "uint256", name: "_orderId", type: "uint256", }, { internalType: "address", name: "_investorWallet", type: "address", }, { internalType: "uint256", name: "_lockingHint", type: "uint256", }, ], name: "adminLockTokens", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "uint256", name: "_orderId", type: "uint256", }, { internalType: "address", name: "_investorWallet", type: "address", }, { internalType: "uint256", name: "_lockingHint", type: "uint256", }, ], name: "dealerConfirmOrder", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "uint256", name: "_amount", type: "uint256", }, { internalType: "bytes32", name: "_investorId", type: "bytes32", }, { internalType: "address", name: "_beneficiary", type: "address", }, { internalType: "address", name: "_investorWallet", type: "address", }, { internalType: "uint256", name: "_lockingHint", type: "uint256", }, ], name: "dealerCreateOrder", outputs: [ { internalType: "uint256", name: "orderId", type: "uint256", }, ], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "uint256", name: "_orderId", type: "uint256", }, { internalType: "address", name: "_investorWallet", type: "address", }, { internalType: "uint256", name: "_lockingHint", type: "uint256", }, ], name: "dealerLockTokens", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "uint256", name: "_orderId", type: "uint256", }, { internalType: "uint256", name: "_lockingHint", type: "uint256", }, ], name: "investorConfirmOrder", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "uint256", name: "_amount", type: "uint256", }, { internalType: "uint256", name: "_lockingHint", type: "uint256", }, ], name: "investorCreateOrder", outputs: [ { internalType: "uint256", name: "orderId", type: "uint256", }, ], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "uint256", name: "_orderId", type: "uint256", }, { internalType: "uint256", name: "_lockingHint", type: "uint256", }, ], name: "investorLockTokens", outputs: [], stateMutability: "nonpayable", type: "function", }, ], })

src/common/provider/mail/templates/OrderCancelled.ts

OrderCancelledTemplate
Default value : ({ orderType, txHashUrl, amount, fundName, instrumentName, txTime, }: IOrderCancelledTemplate) => { const message = `<a href="${txHashUrl}"> ${orderType} order </a> has been cancelled for the amount ${amount} USD in ${fundName} with instrument ${instrumentName}.\n Order was cancelled on ${txTime}.`; const email = addMessageToTemplate({ message, fundName, }); return email; }

src/common/provider/mail/templates/OrderConfirmed.ts

OrderConfirmedTemplate
Default value : ({ orderType, txHashUrl, amount, fundName, instrumentName, txTime, }: IOrderConfirmedTemplate) => { const message = ` <a href="${txHashUrl}"> ${orderType} order </a> has been confirmed for the amount ${amount} in ${fundName} with instrument ${instrumentName}.\n Order was confirmed on ${txTime}. `; const email = addMessageToTemplate({ message, fundName }); return email; }

src/common/provider/mail/templates/OrderCreated.ts

OrderCreatedTemplate
Default value : ({ orderType, txHashUrl, amount, fundName, instrumentName, txTime, investorName, }: IOrderCreatedTemplate) => { const message = ` A <a href="${txHashUrl}"> ${orderType} order </a> has been created for investor ${investorName} for an amount ${amount} in ${fundName} with instrument ${instrumentName}.\n Order was created on ${txTime}, is pending confirmation, and can be cancelled. `; const email = addMessageToTemplate({ message, fundName }); return email; }

src/common/utils/orderGroupRegistryFields.ts

orderGroupRegistryFields
Default value : ( batchRegistry: BatchRegistry[], ): BatchRegistry[] => { return batchRegistry.sort((a, b) => { if (a.dataFieldType === "Bool" && b.dataFieldType !== "Bool") { return -1; } if (a.dataFieldType !== "Bool" && b.dataFieldType === "Bool") { return 1; } if (a.dataFieldType === "Uint" && b.dataFieldType === "String") { return -1; } if (a.dataFieldType === "String" && b.dataFieldType === "Uint") { return 1; } return 0; }); }

src/common/provider/mail/templates/OrderRejected.ts

OrderRejectedTemplate
Default value : ({ orderType, txHashUrl, amount, fundName, instrumentName, txTime, optionalComment, }: IOrderRejectedTemplate) => { const message = ` <a href="${txHashUrl}"> ${orderType} order </a> has been rejected for the amount ${amount} in ${fundName} with instrument ${instrumentName}.\n Order was rejected on ${txTime}. <p>Reason: ${optionalComment}</p> `; const email = addMessageToTemplate({ message, fundName, }); return email; }

src/request-order/schemas/orderRequest.schema.ts

OrderRequestSchema
Default value : SchemaFactory.createForClass(OrderRequest)

src/common/provider/mail/templates/OrderSettlement.ts

OrderSettlementTemplate
Default value : ({ orderNo, orderType, txHashUrl, amount, fundName, instrumentName, lockDate, txTime, navPerShare, shares, navDate, investorId, investorName, investorAddress, instrumentSharesHolding, // eslint-disable-next-line @typescript-eslint/no-unused-vars instrumentSharesInUsd, }: IOrderSettlementTemplate) => { const message = ` <style>${style}</style> <p> We refer to the <a href=${txHashUrl}> ${orderType} order </a> agreement dated ${txTime} (the "Agreement") between ${instrumentName} - ${fundName} and ${investorName} ("Investor") for the ${orderType} of Class ${instrumentName} Participating Shares. </p> <p> The below shows the order details for the fund and the current balance of holdings for ${investorName} (ID: ${investorId} ) of ${investorAddress} </p> <table class="tableStyle"> <tbody> <tr> <td class="headerStyle">Order Number:</td> <td class="cellStyle"> <a href=${txHashUrl}> #${orderNo} </a> </td> </tr> <tr> <td class="headerStyle">Order Type:</td> <td class="cellStyle">${orderType}</td> </tr> <tr> <td class="headerStyle">Fund:</td> <td class="cellStyle">${fundName}</td> </tr> <tr> <td class="headerStyle">Class:</td> <td class="cellStyle">${instrumentName}</td> </tr> <tr> <td class="headerStyle">Total Paid/Received for Shares:</td> <td class="cellStyle">${amount}</td> </tr> <tr> <td class="headerStyle"> Dealing Period Date (Settled Date): </td> <td class="cellStyle">${txTime}</td> </tr> <tr> <td class="headerStyle">Payment Received:</td> <td class="cellStyle">${lockDate}</td> </tr> <tr> <td class="headerStyle">NAV per Share on Dealing:</td> <td class="cellStyle"> ${navPerShare} at ${navDate} </td> </tr> <tr> <td class="headerStyle">Shares Allotted/Redeemed:</td> <td class="cellStyle">${shares}</td> </tr> <tr> <td class="headerStyle">Total Shares Held in Fund:</td> <td class="cellStyle">${instrumentSharesHolding}</td> </tr> </tbody> </table> `; const email = addMessageToTemplate({ message, fundName, }); return email; }
style
Default value : ` .outerContainer { padding: 50px 100px; } .tableStyle { border-collapse: collapse; width: 100%; border: 2px solid black; margin-top:20px; } .cellStyle { padding: 10px; text-align: left; border-bottom: 1px solid black; } .headerStyle { padding: 10px; text-align: left; border-bottom: 1px solid black; background-color: #F2F2F2; } `

src/common/provider/mail/templates/rejectInstrumentAccess.ts

RejectInstrumentAccessTemplate
Default value : ({ investor, instrumentName, }: IRejectInstrumentAccess) => { const message = `Investor, ${investor.name} with email ${investor.email}, is denied by the fund admin to access the instrument ${instrumentName}`; const email = addMessageToTemplate({ message, }); return email; }

src/shared/schemas/Report.schema.ts

ReportSchema
Default value : SchemaFactory.createForClass(Report)

src/request/schemas/request.schema.ts

RequestSchema
Default value : SchemaFactory.createForClass(Request)

src/shared/artifacts/RoleRegistry.ts

RoleRegistry
Default value : Object.freeze({ address: "0xddfF69F60b480aB37Dd79a2B93e4298fceFAf8De", abis: [ ...CustomRegistry.abis, { inputs: [ { internalType: "bytes32", name: "_role", type: "bytes32", }, { internalType: "bytes32", name: "_subRole", type: "bytes32", }, ], name: "createRole", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "address", name: "_contract", type: "address", }, { internalType: "bytes32", name: "_roleManager", type: "bytes32", }, ], name: "setContractManager", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "address", name: "_contract", type: "address", }, { internalType: "bytes4", name: "_selector", type: "bytes4", }, { internalType: "bytes32", name: "_role", type: "bytes32", }, ], name: "grantAccess", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "address", name: "_contract", type: "address", }, { internalType: "bytes4", name: "_selector", type: "bytes4", }, { internalType: "bytes32", name: "_role", type: "bytes32", }, ], name: "revokeAccess", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "address", name: "_contract", type: "address", }, { internalType: "bytes4", name: "_selector", type: "bytes4", }, ], name: "resetAccess", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "bytes32", name: "role", type: "bytes32", }, { internalType: "address", name: "account", type: "address", }, ], name: "grantRole", outputs: [], stateMutability: "nonpayable", type: "function", }, ], })

src/common/constants/Roles.ts

Roles
Default value : Object.freeze({ Admin: "0x0000000000000000000000000000000000000000000000000000000000000000", Dealer: "0x4c494252455f4445414c45525f524f4c45000000000000000000000000000000", DealerManager: "0x4445414c45525f4d414e414745525f524f4c4500000000000000000000000000", FundAdmin: "0x46554e445f41444d494e5f524f4c450000000000000000000000000000000000", })

src/admin/schemas/role.schema.ts

RoleSchema
Default value : SchemaFactory.createForClass(Role)

src/shared/artifacts/RulesEngine.ts

RulesEngine
Default value : Object.freeze({ address: "0xBa590e0616272F94FdF886Da695782c7F9c0dC82", abis: [ { inputs: [], name: "AlreadyInitialized", type: "error", }, { inputs: [], name: "ERC1167FailedCreateClone", type: "error", }, { inputs: [], name: "NotInitializing", type: "error", }, { inputs: [], name: "PermissionedContractAccessDenied", type: "error", }, ], })

test/fixture/s3mockFile.ts

S3File
Type : IFile
Default value : Object.freeze({ originalname: "bhd.jpeg", base64String: "/9j/4AAQSkZJRgABAQAAAAAAAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCADIAMgDASIAAhEBAxEB/8QAGwABAAMBAQEBAAAAAAAAAAAAAAQFBgMCAQf/xABAEAABBAECAgYFCgMIAwAAAAAAAQIDBAUREgYhEyIxQVFhFBWBobEHJDIzNkJScXKRYsHhIzR0g5KisvBzgtH/xAAYAQEBAQEBAAAAAAAAAAAAAAAAAQIDBP/EAB4RAQEBAQACAwEBAAAAAAAAAAABESECMRJBYTJR/9oADAMBAAIRAxEAPwD8oAB6nIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGoirzUurXD6VcPVyr70ToLLtse2NddU111T2KTcXFKCwyGHs0KlW25WyVbLdY5o9dHeKLrzRSLUhZYsNhkm6Ddy3Oark19g1HEF1kuH/AFXlvV1m/A2x1es5rtnPs56fyIOTxtrEXn1Lke2VvPycncqKJZ/q4hgtMJiPXd5tGOy2Cw7dtbI1dHaJqvNPyU6U8HFcy/q1uQijsdI5jekau1zk7kUbDFOD2se2bY9du12jnFzd4bWlhK+Wdfgkgn5R9G12uvPkvLl2KNwxRgsKWOhtVLE7r8UHQN3ObI12vbommicyvXRF5KABZZTCWcTBSmn27LcPSt2/d8l8+afuVqdo3UAXr+GZ14e9c1rEVmBv0o2tVr2prpqqECjQhuQ2HvuxQdA3e5sjV6yaonLTv5jYuIIDkRHaIu4FQAAAAAAAAAAA2eQjik+TfBJLL0bOmf1tu77zjGNTVdNTWZGzQn4KxWNiyMDrVaRzpG9fTRVcvbp5oY8mp9vnEC2E4WxUFdjXYiPdttNd9ZIuuuqfd7+Rma397i/8jfiX97MVYeD6+CrSdPL0nTTTNarWt5ryTXmUdGNjrkXSTRQMa5qudJrp2+SKPH1S+244mwT85x1LBDYia5sLHuj57tqImunLRV8tTNcU5tM7mX2WQuiijjbDG130tEVe3z1VS2z+drx8YRZ3GW4p2t2dVu5q6Imiouqd6fEreK/VljKPv4u02SKz13Q7XNdG9e3tT/upnx/Yt+3TgP7aY/8Azf8Ag492K1eFmayEdprrkFpvRta1dY+vru5/lpy/mceDrNWhxDXv3LUUEUG/du1crtWqnLRF8TmkFKxnrDpsrBFQnmc6Rzd+rmbtdNNC3+k+lI96yPe9303O1Njw+vrngvK4detLW+dV/HzRP2/3GZy00NjM3Zq6/wBk6w90e3s26rp7idwplW4biKvZldtru/spv0r/APF0X2GvLsJ7QHr0OOiZ96d3Su/JNUT37vcc6UTZrbUenUb15P0omq/A65SaGfJWHVk21922Fv8AAnJPcSqbYYMVYnjyUUd121rY+vu2dq80TTXVG9/iPpGgc5/EPyeyuk613Fzb/PYvNfiv+kxJreEM2ypcsetsh8znhdFJHM58i+xERfMzNuCKC2+KGw2eLd1ZG66OTu7UJ48ti3vWj4dziYa3SbY61CzXdFYjd2aK9/P2fDU553BrgsjkIWdarJX313fibvby9hV5CGu2hSWG9BPK2PbJHHu1au5y96JryUuW8QVrnA9jG3l+e1trarna6uZuTVNfJE+HgTO7F/KygAOjAAAAAAAAAAAANVwLVq5HLS07tWKeJsLnt3N56oqd6fmUtCds2Yr9JXgc2SRrXR9H1dFUz8u4uK8Gh4ygr0eIrFGpWigrx7NrWt582ovNfafMXiYG4C7nbrOligd0NeHukkXTmvkmvtHy5pncZ8Fxhpa9/KRUr8EXQWXdFujjSN0aryRUVE8e5eRFymPmwuXsUpdrnQO03beTk7UXTzTQu9wxBBsMnBSl4GpZWlQrRyuk6Gw5rebV58017OxP3QjwYSvPwDYvsa112CZsrvFsa9XT4r7CfJcZcFrFahiwT0fRrOsOk2RzObzaiJ1vLXm33lWxqvcxrE3Odya3zKj4DUcSYepXweKyOPRronN6CaRv3pE7/bo79jLoui6iXSzAGtuw1mcB4/Jx1KzbUlh0UkjY06yJu7l5dyEa5i6k/BlfNwxdBYbN0MjWuXbJ5oi9i/1J8lxmwdIJugl37GyfwyN3IanjOCriM5FXp06za7q7XujdH9JVVdefb3eIt7iYyQL/AC+HgZhKWboI5tWz1JIXO3dFImvJF8F0XtKAsunoABUAAAAAAAAbD5OPtJN/hX/FpRY201cpVT0SD65n3V8U8zpg8/NgZ3z1qtaWVzdnSTbuxe7RFRO4iQXmV8g20ylB1Xbmxuc/a1UXX8WvvMZ21reLjjz7Z3f8r/g0nNe2z8lT2RfTqXNZG+SryX3p+xn8zmH5u6+3PWgjndt3Oh3dbRNE5KqnGhkrGPWVIVa6KduyaGTrNkTwVP59oy5Pw3tesLE6fO4+Jidd1hif7kLXjmxFY4uurEu7btY53miJr7+XsKyplVx8z56MDY7G3Rsjnblj17dvh+a6le5Vc7Vy7n9u4ud1N5jY8Ka5ThzO4P6TnR+kwt/iT+qNOnCVmKTiG7h5V+b267q36lY3RF/ZHfuZjEZWxhb3plXbu2ub1uzRU0/r7DjRuy0MhXuw/WwSNe3d2cvEzfH2vyd8pA+lMyhInXrN0k/Uq6r7tE9h5xrWpM+d79rIG7mud+Lsb7119hxu2pb12xbm+tnkc923s1VdSQzItjxj6PoFZzXOa90zt+/VEVE+9p3r3GvpGp4fiiy3CWVwbZ2zyxt9Jrta1ddU7U5+aJ/qMOWuDzs+Bt+k1q8DrG3buk3di+SKhBtWEs23zpXig3O16OPXb71USZat7GtnlZF8meKdLA2dvpjtzXOVv4/BThxlAsEGNdRe71HPHvrwt7I3d+vivPXVefNSsm4ifPg4sQ6hT9Fjdvj279zXc+eu7zU8R8QWEwXqeaCCeq12+PpN26NfJUVPFf3MyXdXYqDX/KN9o4v8Kz4uMpC9sUu58LZWfhk109yopa5biF+auMtXKFN0rW7Orvamif8At5mrO6k9Lq09tb5LKUMv1tm050be/RFXVf8AviYwl38jayUrH2X7ujbsja1u1sbe5EROxCIJMZt0ABoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/9k=", fileType: "image/jpeg", })

src/security/schemas/security.schema.ts

SecuritySchema
Default value : SchemaFactory.createForClass(Security)

src/orderbook/schemas/settlement.schema.ts

SettlementSchema
Default value : SchemaFactory.createForClass(Settlement)

src/common/provider/web3/signer.ts

transactionQuery
Default value : async ({ contractAddress, queryName, contractName, args, }: ITransactionQuery): Promise<string | null> => { try { const contract = new ethers.Contract( contractAddress, getContractByName[ContractName[contractName]].abis, provider, ); return await contract.getFunction(queryName).staticCall(...args); } catch (error) { throw new ServiceUnavailableException(`${error}`); } }
transactionSubmitter
Default value : async ({ signerKey, contractAddress, transactionName, contractName, args, }: ITransactionSubmitter): Promise<ContractTransactionResponse | null> => { try { const kms = new KMS({ region: process.env.KMS_REGION, }); const decryptedPrivateKey = await kms .decrypt({ KeyId: process.env.KMS_KEY_ID, CiphertextBlob: Buffer.from(signerKey, "base64"), EncryptionAlgorithm, }) .promise(); const signer = new ethers.Wallet( decryptedPrivateKey.Plaintext.toString(), provider, ); const contract = new ethers.Contract( contractAddress, getContractByName[ContractName[contractName]].abis, ); return await contract .connect(signer) [transactionName](...args, { type: 0, block_gas_limit: 50_000_000 }); } catch (error) { let errorMsg = `${error}`; console.log(`error message is`, errorMsg); if (error.code === "CALL_EXCEPTION") { const contractInterface = new Interface( getContractByName[ContractName[contractName]].abis, ); const decodedError = contractInterface.parseError(error.data); console.log("Custom error:", decodedError); errorMsg = `Custom error: ${decodedError?.name}`; } console.error("Error:", error); throw new ServiceUnavailableException(errorMsg); } }

src/common/provider/mail/templates/UpdateNav.ts

UpdateNaveTemplate
Default value : ({ txHashUrl, amount, fundName, instrumentName, txTime, isAudited, }: IUpdateNaveTemplate) => { const message = `We want to inform you that the Net Asset Value(NAV) of ${instrumentName} of ${fundName} equal ${amount}USD for this month as ${ isAudited ? "audited" : "unaudited" } NAV kindly check the <a href="${txHashUrl}"> transaction</a> on ${txTime}.`; const email = addMessageToTemplate({ message, }); return email; }

src/common/provider/mail/templates/UserIsBlacklisted.ts

UserIsBlacklistedTemplate
Default value : ({ type, email: emailId, fundName, }: IUserIsBlacklistedTemplate) => { const message = `The ${type} account, with email ${emailId} was denied access to the ${fundName} fund. You will be contacted to resolve issues.`; const email = addMessageToTemplate({ message, }); return email; }

src/user/schemas/user.schema.ts

UserSchema
Default value : SchemaFactory.createForClass(User)

src/common/constants/getUserAccreditationScore.ts

UserScoreByAccreditation
Type : Record<UserAccreditation, string>
Default value : Object.freeze({ Sophisticated: "1", Advised: "2", Professional: "3", })

src/wallet/schemas/wallet.schema.ts

WalletSchema
Default value : SchemaFactory.createForClass(Wallet)

results matching ""

    No results matching ""