Cross contact call from contract on Aurora to Near smart contract - aurora-evm

Is it possible to call Near contract function from smart contract on Aurora (Solidity) and get the result? If it's possible, how it can be done?

Related

Typeorm find row that has not been commited in transaction

in my database i have a 'companies' table with taxId UQ column.
In my code i have a companiesRepository class that have tree methods:
findCompany: Performs an SELECT to find company by an UQ (taxId)
createCompany: Performs an INSERT
findOrCreate: Recives a taxId and try to find using findCompany, if isnt found, calls createCompany to insert this company.
Since on my endpoints, i recieve an tree structure data of companies and invoices informations, im using, TypeORM as my ORM and it queryRunner to manage transactions and rollback in case of problems during the flow.
The things is, when i recieve and register an invoice, i need to associate it to a companyRow by an taxId, if this company is not register i register than, otherwise i just SELECT this company from the bank (using this findOrCreate method)
The problem is, on the same request payload, i can recive many invoices. Supposing that i recived an invoice from a company that has not been registered, my findOrCreate companyRepository method, will not found and will register this company. After this, its possible an common to recive another invoice from the same company, since i didnt commit the transaction yet, because the whole endpoint flow is not completed, the findOrCreate will not found this company, and try to create again, after all throwing an execption by violating UQ constrant.
How can i solve this?
Thank you.
Techs used:
"#nestjs/common": "^9.0.0",
"#nestjs/core": "^9.0.0",
"#nestjs/typeorm": "^9.0.1",
"typeorm": "^0.3.10"
"pg": "^8.8.0",
My ideas was: stop using transacion for creating companies (its working by now) but doesnt seem kinda right.
Or even, just for companies, dont use the endpoint flow queryManager, uses an own queryManager and commit right after created, so it can be founded after it.
But i would like to know if its possible to keep everything inside this endpoint/global queryManager, and still be able to found an row even if isnt commited on the database yet.
It sounds like your findOrCreate method is not using the same connection and thereby the same transaction.
You should be able to see the effects of a current transaction in the same transaction, even if not committed.

Docusign REST API call: Using logical operators for search_text

I’m trying to use a REST API call to find all envelopes with subjects that are either {{cSubject_1}} OR {{cSubject_2}}.
I’m using "search_text" for filtering but I’m not sure how I should use the logical operator for “OR” for this purpose.
I would appreciate if you could help me with this.
Thanks,
Kathy
There's currently no support for this type of complex query in the search_text for The Envelopes:listStatusChanges endpoint.
The search_text allows you to have a single text item that is search across the board (recipients, subject, etc.) and is not limited to a specific meta-data. You can use other filters to filter by other means.
I would recommend storing envelope's meta-data in your application storage (or database) and using your own code to query this information if possible.

Returning all data types for a table in SOQL

Is there a simple way to query and return a list of datatypes for all columns in a SOQL table?
I'm trying to migrate SOQL to PostgreSQL but have 100s of tables and 100s of columns and don't want to go through querying every data type or doing it by hand.
In PostgreSQL the equivalent to what I'm looking for would be:
SELECT table_name, data_type, columns.character_maximum_length, columns.udt_name
FROM information_schema.columns
WHERE table_schema = 'public';
Looking around it looks like I might have to go into Apex? But I'm wondering if there's any simpler way. I don't think that SOQL supports information_schema and can't find if there's a simlar
There's no way to introspect schema in SOQL itself. While you can interact with the Describe API via Apex, it's easier as an external API client to do so via the Salesforce REST API.
Specifically, you'd want to hit the Global Describe endpoint to get the list of available sObjects.
The, for each sObject, hit sObject Describe. The response body includes field details for that sObject under the fields key. The field's type is given in each fields entry as both type, which is a high-level UI-oriented type (see DisplayType enum), and as the lower-level soapType, which is usually more relevant for database storage and API interaction.
Note that in both cases the API will enforce FLS and CRUD based on the authenticated user account's credentials. If a logged-in user with those credentials doesn't have permission to see an object or field, neither will your external application.

In which case will this error occurs "Restricted dimension(s): ga:userAgeBracket, ga:userGender can only be queried under certain conditions"?

I'm using Google Analytics Core Reporting API v4. When I query using the dimensions: ga:userAgeBracket & ga:userGender, I get the following error:
Restricted dimension(s): ga:userAgeBracket, ga:userGender can only be queried under certain conditions
Can someone tell me why this error occurs?
Not all dimensions and metrics can be queried together. This can be for several reasons it may not make sense to have them mixed. It may also be that a relation between them does not exist.
My guess would be that there is no relation between ga:userAgeBracket, ga:userGender. Gender came from double click cookie.

Handling an SQL Injection attack

What should an Incident Handler do (or) follow when an SQL injection attack is reported?
Initial Response
Analysis
Action
Aiming to make a Procedure guide to follow for myself and my team.
Brief or detail, anything would help.
Not a full process, but it should get you started:
Initial Response
Verify that the reported vulnerability is legitimate, preferably in a production-safe manner
See the OWASP SQL Injection Testing guide for more information on how to do this
Analysis
Determine the cause of the SQL Injection
This is probably a location where user input is directly concatenated into a SQL query
Action
The best defense against SQL Injection is to utilize parameterized/prepared statements instead of direct string concatenation when building a query based on user input.
These statements provide a clear divide between data and syntax, so that user input is never treated as SQL syntax but instead treated as data
How you do this will depend on the language and framework used in your application
See the OWASP SQL Injection Prevention Cheat Sheet for more information on preventing SQL injection