idriss-crypto / ts-library Goto Github PK
View Code? Open in Web Editor NEWLibrary for integrating IDriss into your project.
Home Page: https://www.idriss.xyz
License: GNU General Public License v3.0
Library for integrating IDriss into your project.
Home Page: https://www.idriss.xyz
License: GNU General Public License v3.0
Describe the bug
When calling the tipping function transferToIDriss()
with ERC20 (+ nft?), the getApproval function of the respective asset is called even though an approval previously given exists.
To Reproduce
Expected behavior
When an approval exists, we should not ask to approve again.
Is your feature request related to a problem? Please describe.
Specifically when using multiSend, it is still common (if not the standard), to use wallet addresses (or ENS names -> resolving takes place on the front end?) as identifiers. If no reverse record is set up for a given address, we currently cannot pass this identifier to multitransferToIDriss()
.
Describe the solution you'd like
beneficiary
in sendParams
should also accept evm compatible wallet addresses.
Describe alternatives you've considered
ENS names should also be accepted. there could either be front-end resolving which just passes the address as beneficiary
, or a separate ENS resolver in the library. For simplicity, I recommend using front-end resolving for now.
Describe the problem
There is no test for the case of existing and nonexisting identifiers in one call.
Additional context
payments.js
tests all other configurations. Adding the mixed case would complete these tests.
The current registration flow requires a front-end to manually build a transaction with
await paymentContract.methods.payNative(receipt_hash, idHash, "IDriss").send({
from: selectedAccount,
value: 0,
gasPrice: valid.gas,
gas: GAS_LIMIT_PAY_NATIVE
});
where all values are calculated in a front end. This can be simplified for everyone by just creating a makePayment()
function which accepts a web3Prover
, calculates everything and triggers the payment.
Describe the solution you'd like
Add a function revertPayment()
to base IDriss so we can run revert hash transactions through this library.
Describe alternatives you've considered
Calling the contract directly also works, but is less sexy.
Additional context
Add tests to payments.ts
I tried to import the AssetType this way
import { AssetType } from "idriss-crypto/lib/types/assetType";
but I'm getting this error
Module not found: Package path ./lib/types/assetType is not exported from package
Describe the bug
Transactions fail due to transaction underpriced
or other errors. Origin is most likely found in transactionOptions.gas
, which was historically set to some default value.
To Reproduce
Open IDriss Send and try to send something to more than 5 identifiers.
Expected behavior
Gas should be calculated correctly with contract.methods.methodName().estimateGas()
so that the gas option can be left out in the library call.
Describe the bug
When calling multitransferToIDriss()
with handles that are registered AND others that are not registered, two transactions are triggered. Only the latter one (transaction to un-registered IDriss handles) is returned from multitransferToIDriss()
To Reproduce
Steps to reproduce the behavior:
Call multitransferToIDriss()
using an existing, and a new handle.
Expected behavior
While the more critical transaction hash is returned, an array of transaction receipts should be returned for completeness.
Is your feature request related to a problem? Please describe.
This library has new features that are not added to the readme documentation yet.
Describe the solution you'd like
Add revertPayment() documentation as well as info that addresses are accepted.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.