netgum / archanova Goto Github PK
View Code? Open in Web Editor NEWArchanova monorepo
Home Page: https://archanova.io/
Archanova monorepo
Home Page: https://archanova.io/
When I call the sdk.estimateWithdrawFromAccountVirtualBalance()
it should just return me the estimated object, but instead, it additionally creates a Withdrawal transaction
When a deploy account transaction is submitted by the relayer with 0Gwei set as the gas price (#52 ) the next state is locked at "Deployed" preventing the sdk from attempting to submit a new transaction.
On develop
branch preview
const gasPriceStrategy = sdkConstants.GasPriceStrategies.Avg
let sdkEnv = getSdkEnvironment(SdkEnvironmentNames.Kovan)
let sdk = new createSdk(sdkEnv)
/* initialise and connect to existing account */
// this line throws an error
const estimate = await sdk.estimateAccountDeployment(gasPriceStrategy)
// this is returned from the server
errors: { gasPrice: 'any.required' } }
Connected account: 0xbC4Fd6EAe7c876b5fdD0161AaF3a30e79406C04f
When trying to estimate & submit a transaction from the newly created account, the SDK throws a, account is in created state, error, when using getConnectedAccountDevices, the client device entry's state is "Created" where as all the other entries are deployed.
When I tried to call the estimateWithdrawAccountPayment(hash)
method, I got an error:
{reason: "[ethjs-abi] invalid hex string, hex must be prefixed and alphanumeric (e.g. 0x023..)", value: null}
Steps to reproduce:
A function which takes accepts eth in exchange for tokens, which returns any remaining eth sent, only reverts when the transaction is sent via Abridged & not remix or any ganache tests.
Network Sokol
This is a follow-up to issue #39, I've moved away from a Typescript environment with react-scripts-ts
and I'm using the latest [email protected]
from [email protected]
.
I'm still getting issues with the dev environment but this time with the following error:
TypeError: Cannot destructure property
createHash of 'undefined' or 'null'.
However I've also tested it with the boilerplate create-react-app without any of my code and just installing the @archanova/sdk
and it worked
But can't get it to work with my setup which has the following dependencies:
{
"dependencies": {
"@archanova/sdk": "^1.0.0",
"@netgum/utils": "^0.1.3",
"axios": "^0.19.0",
"connected-react-router": "^6.5.2",
"history": "^4.9.0",
"prop-types": "^15.7.2",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-redux": "^7.1.0",
"react-router-dom": "^5.0.1",
"react-scripts": "3.0.1",
"redux": "^4.0.1",
"redux-thunk": "^2.3.0",
"styled-components": "^4.2.1"
}
}
Provide error message that ens name has already been taken instead of returning 500 error.
When using any command In the CLI documentation, the console will read that there is a console error
I used the getTokens
and getToken
method on the playground and I couldn't find the token I transferred to the active account.
accountAddress: 0x2AC21C80e9bA7f8FB21e18086D439ccdc9DE823A
tokenAddress: 0x3615757011112560521536258c1E7325Ae3b48AE
However I could top up the virtual balance using the token contract address so this issue wasn't too critical. So when I query the accountVirtualBalances, I get the following response:
The token contract address gets listed on the virtual balances but it doesnt identify the name and symbol.
When I receive a Completed AccountTransactionUpdated event, I expect to be able to access the Account's balance and receive the updated value.
Currently I have to set a 500ms timeout before accessing the balance else they do not contain the updated value(s).
This error is thrown after the account Deployment is done and before execute transaction.
The error thrown by the call to estimateAccountTransaction
and we have work around currently by commenting the code that is throwing that error. Not sure why we have that error thrown. Because device is connected and account is connected.
After collecting a signature for a social recovery with the settings of 1 Required Friend, with 1 Friend account set up.
Submitting of social recovery returns an error of revert.
Possibly linked to the 0 Gwei gas issues (#60 #52 #56 ) as submitAccountFriendRecovery
returns a hash and theres an issue with creating estimations to execute
Think this is probably a duplicate of #64, but I'll describe in more detail here.
I have a pattern:
- client generates device
- device key sent to server
- server connects to pre-deployed acc contract
- server adds client device key as new account device
- server deploys this new device
- client should now be in a state where they are using a deployed device (after tx is mined)
What I notice, is that even when the tx is mined, the device (as seen by client) is not in the deployed state.
I also notice that after the server calls createAccountDevice
, even if the client calls getConnectedAccounts
, there are 0 accounts in the returned array.
I have worked around this by repeatedly calling getConnectedAccounts
until I see what I expect, but this would be much simpler if there was some synchronicity.
SDK should support calling contract method, broadcasting signed message and getting refund (like contract deployment).
const contract = sdk.contract.createInstance(contractAddress, abi);
const estimate = await contract.estimateCall('approve', ...args);
const data = await contract.call('approve', ...args);
This is probably documented somewhere else but I was wondering why the account creator gets paid slightly more than the gas fees of the TX.
For example
https://kovan.etherscan.io/tx/0xee99ff45fadc0c35f9f7c30ef9d6e3942d6ec529ca54b174fb0b111d425ec023
gas cost: 0.00191435147774
Eth transferred: 0.00219528361
How is the fee calculated?
If i didn't set the storageAdapter and I didn't yet deploy the account, I cannot initialize the SDK without the accountAddress.
So it would be good to update to the options on the initialize()
like such:
const options = {
device: { privateKey: "0x50bd9919ab6d896384a94f22641ba5a3fc1a29aecf157653d24bf4e1a2d5449b" },
account: { address: "0x5272B38770B559E501c4020F131D4cc2450b3057" }
};
sdk
.initialize(options)
.then(() => console.log('initialized'))
.catch(console.error);
If the account is not yet deployed, calling connectAccount will delete the localStorage values for account
and account_device
Following are the details of the account
accountAddress : "0x1f4C808b10082F4ab6638b1b774621C0819e0553" (Already Deployed)
ensName: "y12-1.archanova.kovan"
This was working well last night but just started giving me error as we started
A flow of of functions in a typical flow for SDK's various states of user and contract extension states would provide insight in to system design
Account Contract has enough gas but submitAccountTransaction fails on calling second time.
Execute transaction works the first time but fails with an internal server error for the second time.
` const accountObject = await sdkInit.estimateAccountTransaction(
contractAddress.bettingContractAddress,
'0',
this.state.contractInstance.methods
.requestWithdrawal(
web3.utils.toWei(withdrawAmount, 'ether'),
withdrawalAddress,
)
.encodeABI(),
);
console.log('Account Object =>', accountObject);
// Execute Transaction
let executeTransaction = await sdkInit.submitAccountTransaction(
accountObject,
);`
Rinkeby env, 1.1.0.
This is what Etherscan displays:
But my balance in sdk.state.account.balance.virtual
is 0.01
, I expect it to be 0.02
.
Proxy contract: https://rinkeby.etherscan.io/address/0x030dd09b84d60db9bb624379331f1be2f05fb1f9
Account contract: https://rinkeby.etherscan.io/address/0x359280c417d6c782db1da040ac46fdd27ecaa8ba
When following the redux middleware guide, the code will throw an undefined
error.
When running from Typescript, const sdk;
will throw an error stating const variables must be initialized.
Intermittently on Sokol, transactions will be submitted with a gas price of 0, even with explicit gas price of 1 being set. const gasPrice = anyToBN(0x3B9ACA00);
Forwarding 0.02Eth to an account: https://blockscout.com/poa/sokol/tx/0x3cb36122abbea502770acab0d0ad8c1a63a8480322ea599bc130b3880fd407b4/internal_transactions
Account deploy: https://blockscout.com/poa/sokol/tx/0x7c702258a310f4d4ac5a179bfdde19d96af8c73fd6357fce0779e5e541c8487d/internal_transactions
Account deploy: https://blockscout.com/poa/sokol/tx/0xfccc3842a1b7f9b82614154960847f358bed01b18dfb3d0524a890fbfe5f8ff4/internal_transactions
Account deploy: https://blockscout.com/poa/sokol/tx/0x11f0ba2e3fbf8872dbef5d23a1318d274e4a167cc5a8d3c56426a9224f89f5b9/internal_transactions
Purpose of CLI is unclear in context of the SDK, readme requires an update to provide purpose as well as examples of use.
If I have not enough funds to deploy the account, I'll get a 500 error from the server
A deployed account had an attempt at deploying an account recovery extension. However it cant be queried, the setup account recovery function is forbidden, attempts to deploy the extension result in a null transaction hash.
When fetching a specific account creation transaction the value, fee and gas object are all 0x0
https://kovan.etherscan.io/tx/0xee99ff45fadc0c35f9f7c30ef9d6e3942d6ec529ca54b174fb0b111d425ec023
Failed to compile because I got the following error message:
Could not find a declaration file for module 'ethjs'
I tried to install @types/ethjs
but wasn't successful
I managed to work around it by adding an empty declaration to the root directory index.d.ts
declare module "ethjs";
But then I ended getting a different error that I couldn't fix:
Cannot use namespace 'IProvider' as a type.
Trying to deploy SDK through sdk.deployAccount() causes internal server error with 500. It has enough ETH in the account address for deployment. We are trying launch Yolorekt pretty soon, please address this asap. Happy to get on a call if something is wrong on our end. The same of piece of code was working 2 days ago for account deployment by the yolorekt client.
Sdk backend server returns internal server error instead of returning appropriate error.
Precisely we are using sdk.accountDeploy() returns internal server error
Run:
$ npm i @archanova/cli -g
$ npm i @archanova/sdk -S
$ npm run bootstrap
$ npm run compile
$ npm run start:sdk:playground:5100
Error:
[email protected] start:sdk:playground:5100 /home/dekan/github/playground/archanova
cross-env PORT=5100 lerna run --stream --scope "@archanova/sdk-playground" start
lerna notice cli v3.13.4
lerna info filter [ '@archanova/sdk-playground' ]
lerna info Executing command in 1 package: "npm run start"
@archanova/sdk-playground: > @archanova/[email protected] start /home/dekan/github/playground/archanova/packages/sdk-playground
@archanova/sdk-playground: > react-scripts start
@archanova/sdk-playground: There might be a problem with the project dependency tree.
@archanova/sdk-playground: It is likely not a bug in Create React App, but something you need to fix locally.
@archanova/sdk-playground: The react-scripts package provided by Create React App requires a dependency:
@archanova/sdk-playground: "webpack": "4.29.6"
@archanova/sdk-playground: Don't try to install it manually: your package manager does it automatically.
@archanova/sdk-playground: However, a different version of webpack was detected higher up in the tree:
@archanova/sdk-playground: /archanova/node_modules/webpack (version: 3.12.0)
...
Workaround:
disable preflight check by addding this to sdk-playground/.env allows it to proceed
SKIP_PREFLIGHT_CHECK=true
Steps to reproduce:
Is it possible to make the estimateAccountDeployment()
method static? Or create a similar one. So we could get the tx fee estimate before we actually initialize the sdk and create an account?
I did a fresh install of the master branch and attempted to get the SDK running on local, however it crashes throwing an error about too many params.
REACT_APP_ACTIVATE_HELP=1
REACT_APP_ACTIVATE_MAIN_SDK_ENV=1
REACT_APP_ACTIVATE_LOCAL_SDK_ENV=1
REACT_APP_ACTIVATE_XDAI_SDK_ENV=1
REACT_APP_LOCAL_SDK_ENV_PORT=8545
REACT_APP_AUTO_INITIALIZE_SDK=1
REACT_APP_AUTO_ACCEPT_SDK_ACTIONS=1
Failed to compile.
@archanova/sdk-playground: Expected 0-1 arguments, but got 2. TS2554
@archanova/sdk-playground: 99 | .logger
@archanova/sdk-playground: 100 | .wrapSync('sdk.getConnectedAccountPayments', async (console) => {
@archanova/sdk-playground: > 101 | console.log('accountPayments', await this.sdk.getConnectedAccountPayments(pageParsed, {
@archanova/sdk-playground: | ^
@archanova/sdk-playground: 102 | state: filtersStateParsed,
@archanova/sdk-playground: 103 | }));
@archanova/sdk-playground: 104 | });
I've ran into a hash that cannot be deposited through the sdk. I am using ropsten, but cant figure out what the problem is. I've deposited many more but this specific one does not go through: 0x0288dff5fbecc8dd82c472824c1d6763778e4aa99163ce2c4bd6b107bcd104e9
Some access to the relayer logs would be wonderful :)
Rinkeby env with 1.1.0.
Account contract: 0x863d89960C447EBCD7f37EB725A15C17433F7DCF
Proxy contract: https://rinkeby.etherscan.io/address/0x117547f447780df51c6835c1d4d4ddd18b47e5d0#code
Virtual balance manager displays this on Etherscan, but SDK virtual balance stays at 0.
Revert error is throwing when try to use:
await this.sdk.deployAccount(sdkConstants.GasPriceStrategies.Avg);
THE CODE:
const accountBalance = await this.provider.getBalance(this.props.accountAddress);
console.log('HERE Account Balance', accountBalance.toString()) // 20000000000000000
const estimateResult = await this.sdk.estimateAccountDeployment(sdkConstants.GasPriceStrategies.Avg)
console.log('HERE Estimate Result', estimateResult.totalCost.toString()) // 650000000000000
let totalCost = ethers.utils.parseEther('0.01').add(estimateResult.totalCost.toString());
console.log('HERE TOTAL COST', totalCost.toString()) // 10650000000000000
if (accountBalance.gte(totalCost)) {
const hash = await this.sdk.deployAccount(sdkConstants.GasPriceStrategies.Avg);
}
THE ERROR:
Error: reverted
at new Error (Error.js:7)
at Function.fromAny (Error.js:32)
at Function.throwFromAny (Error.js:38)
at Sdk.js:46
at shims.js:1
at K (shims.js:1)
at z (shims.js:1)
at E (shims.js:1)
at MessagePort.p (shims.js:1)
Tested both on kovan
and ropsten
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.