airgap-it / airgap-coin-lib Goto Github PK
View Code? Open in Web Editor NEWA library that offers a unified API to prepare, sign and broadcast multiple cryptocurrencies.
Home Page: https://airgap-it.github.io/airgap-coin-lib/
License: MIT License
A library that offers a unified API to prepare, sign and broadcast multiple cryptocurrencies.
Home Page: https://airgap-it.github.io/airgap-coin-lib/
License: MIT License
Assigning this to @AndreasGassmann
I've cloned this repo, did npm i
and according to https://github.com/airgap-it/airgap-coin-lib/blob/master/examples/readme.md
$ npx ts-node examples/serializer/create-qr.ts
/usr/local/lib/node_modules/ts-node/src/index.ts:859
return new TSError(diagnosticText, diagnosticCodes, diagnostics);
^
TSError: ⨯ Unable to compile TypeScript:
examples/serializer/create-qr.ts:6:3 - error TS2322: Type 'number' is not assignable to type 'string'.
6 id: generateId(8),
~~
packages/serializer/src/v2/message.ts:22:3
22 id: string
~~
The expected type comes from property 'id' which is declared here on type 'IACMessageDefinitionObject'
examples/serializer/create-qr.ts:37:3 - error TS2322: Type 'number' is not assignable to type 'string'.
37 id: generateId(8),
~~
packages/serializer/src/v2/message.ts:22:3
22 id: string
~~
The expected type comes from property 'id' which is declared here on type 'IACMessageDefinitionObject'
examples/serializer/create-qr.ts:48:20 - error TS2673: Constructor of class 'SerializerV3' is private and only accessible within the class declaration.
48 const serializer = new SerializerV3()
~~~~~~~~~~~~~~~~~~
examples/serializer/create-qr.ts:52:16 - error TS7006: Parameter 'serialized' implicitly has an 'any' type.
52 .then(async (serialized) => {
~~~~~~~~~~
at createTSError (/usr/local/lib/node_modules/ts-node/src/index.ts:859:12)
at reportTSError (/usr/local/lib/node_modules/ts-node/src/index.ts:863:19)
at getOutput (/usr/local/lib/node_modules/ts-node/src/index.ts:1077:36)
at Object.compile (/usr/local/lib/node_modules/ts-node/src/index.ts:1433:41)
at Module.m._compile (/usr/local/lib/node_modules/ts-node/src/index.ts:1617:30)
at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
at Object.require.extensions.<computed> [as .ts] (/usr/local/lib/node_modules/ts-node/src/index.ts:1621:12)
at Module.load (node:internal/modules/cjs/loader:1207:32)
at Function.Module._load (node:internal/modules/cjs/loader:1023:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12) {
diagnosticCodes: [ 2322, 2322, 2673, 7006 ]
}
For AE tokens in the wallet, we see a balance $0.0, without any chart showing the token price changes.
Seems like the functionality is handled here:
When fetching the price directly it works:
$ curl -s "https://min-api.cryptocompare.com/data/price?fsym=AE&tsyms=USD" | jq '.'
{
"USD": 0.1917
}
It worked fine couple months ago.
naming on two methods is misleading:
TezosKtProtocol.delegateInfo returns DelegationRewardInfo
and
TezosKtProtocol.isAddressDelegated returns DelegationInfo
The naming would suggest that I receive in the first call "DelegationInfo" (because I'm not asking form rewards info) and the second call I would expect to receive a boolean.
-> change the naming or change the return.
Airgap currently uses a very basic protocol to sync wallets, send requests for signing transactions and broadcast signed transactions.
We propose a new protocol that does replace the existing one with the following design goals:
The following data is necessary for a user to verify his transaction properly:
Coins/Protocols might add data that is necessary for proper signing such as data
in case of Ethereum, or Inputs/Outputs
in case of Bitcoin.
This protocol solves a couple of similar use cases such as EIP 681, although not completely the same. We aim to use the protocol to facilitate communicate between cold-storage wallets / devices and internet-connected devices using a one-way method such as cameras (=> QR Codes). This adds another design goal, size-efficiency. EIP 681 or similar protocols in Bitcoin, rely on the receiver having access to the internet in order to fetch necessary properties (fpr example nonce
or UTXO
).
The protocol consists of two layers:
We chose RLP as our serialization method due to two reasons:
We use base64 to encode the data when embedded in a URL-Scheme to further shorten the amount of characters necessary in comparison to HEX-Data (Base16).
The type of request that is encoded in the protocol is always determined by the scheme / url that the request is sent to. The data itself does not include information about "what" it is, similar to how an ethereum TX does not do that. As we always have to include some kind of URL-Scheme regardless, this information would be redundant anyways.
Version: [number]
Protocol Identifier: [string]
Public Key: [string]
Derivation Path: [string]
isExtendedPublicKey: [1 || 0]
In case of syncing an ETH wallet, this could look sth like this:
[
[1], // version
['eth'], // protocol identifier
['03c2c5da503a199294e2354425f9571d060a3a5971b4c61fcdccaf035d0fb18e6d'], // public-key
['m/44'/60'/0'/0'], // derivation path
[0], // whether is an extended publicKey or not
]
[[1],['eth'],['03c2c5da503a199294e2354425f9571d060a3a5971b4c61fcdccaf035d0fb18e6d'],['m/44'/60'/0'/0'],[0]]
Which base64-encoded and embedded in a scheme equals:
airgap-wallet://sync?data=+F/BAcSDZXRo+ES4QjAzYzJjNWRhNTAzYTE5OTI5NGUyMzU0NDI1Zjk1NzFkMDYwYTNhNTk3MWI0YzYxZmNkY2NhZjAzNWQwZmIxOGU2ZM+ObS80NCcvNjAnLzAnLzDBgA==
Version: [number]
Protocol Identifier: [string]
From: [[string]...]
To: [[string]...]
Amount: [BigNumber.toString]
Fee: [BigNumber.toString]
Public Key: [string]
Callback: [string]
Unsigned Transaction: [any]
Given the following Ethereum TX:
{
'nonce': '0x00',
'gasPrice': '0x04a817c800',
'gasLimit': '0x5208',
'to': '0xf5E54317822EBA2568236EFa7b08065eF15C5d42',
'value': '0x0de0b6b3a7640000',
'data': '0x',
'chainId': 1
}
made from the address 0x7461531f581A662C5dF140FD6eA1317641fFcad2
, encoded in RLP this would give us sth like this:
[
[1], // version
['eth'], // protocol identifier
['0x7461531f581A662C5dF140FD6eA1317641fFcad2'], // from
[], // to, in this case we can extract it from the payload
[], // amount, also possible to extract from the payload
[], // fee, also possible to extract from the payload
['03c2c5da503a199294e2354425f9571d060a3a5971b4c61fcdccaf035d0fb18e6d'], // public-key
[], // callback scheme
[
['0x00'], //nonce
['0x04a817c800'], // gasPrice
['0x5208'], // gasLimit
['0xf5E54317822EBA2568236EFa7b08065eF15C5d42'], // to
['0x0de0b6b3a7640000'], // value
['0x'], // data
[1] // chainId
]
]
[[1],['eth'],['0x7461531f581A662C5dF140FD6eA1317641fFcad2'],[],[],[],['03c2c5da503a199294e2354425f9571d060a3a5971b4c61fcdccaf035d0fb18e6d'],[],[['0x00'],['0x04a817c800'],['0x5208'],['0xf5E54317822EBA2568236EFa7b08065eF15C5d42'],['0x0de0b6b3a7640000'],['0x'],[1]]]
Which base64-encoded and embedded in a scheme equals:
airgap-vault://sign?data=+JnBAcSDZXRo1ZR0YVMfWBpmLF3xQP1uoTF2Qf/K0sDAwPhEuEIwM2MyYzVkYTUwM2ExOTkyOTRlMjM1NDQyNWY5NTcxZDA2MGEzYTU5NzFiNGM2MWZjZGNjYWYwMzVkMGZiMThlNmTA8cEAxoUEqBfIAMOCUgjVlPXlQxeCLrolaCNu+nsIBl7xXF1CyYgN4Lazp2QAAMGAwQE=
Currently, Airgap does not support Bitcoin Multi-Signature, which is a very common when you are holding a big amount of bitcoin and want to secure it.
We would like to see support for
Since we are using bitcoin.js which is already supports multisig like here https://github.com/bitcoinjs/bitcoinjs-lib/blob/1f92ada3fda587c1c0a6aa93649afa04e8382b93/test/integration/transactions.spec.ts#L204
You're using dependencies like:
airgap-coin-lib/packages/core/package.json
Lines 40 to 44 in 3c517e3
These can be replaced by audited noble cryptography. It's fast and modern, supports ESM and tree-shaking.
I accidentally added a random "Z" in the yarn.lock and got this exact error. The error pointed at line 51, but the Z was way down in the middle of the file. Checking for typos is a good first step if you get this error.
Originally posted by @kylezeeuwen in yarnpkg/yarn#6152 (comment)
Hi, I would like to add support for a token of the bittensor project based on substrate. I noticed you already have substrate integration so I anticipate it will be manageable to implement.
AFAIK there is a devteam-hosted block explorer (and RPC node) which is based on polkadotjs as well as a dockerized RPC node available.
I hope to start working on this soon. Thanks.
Hi there 👋
Currently, I see it implemented in https://www.npmjs.com/package/@airgap/angular-core, but I can't find its sources published and it also depends on angular.
BSC, Cronos, Solana, Terra, Avalanche, Fantom, Harmony, Elrond (i know they wont all be possible in the near term, but whichever integrations wouldnt be too extensive, let me know which would be most easiest and ill see if i can make it happen. I say that because i am just starting in blockchain development, but i really want to do this to gain experience and to have something highly productive and scalable to show a recruiter. Of course I am going to change some things, personalize the design and make a fork for my portfolio,
comment your suggestions for easiest blockchain integration for me to get started or a specific DApp if you think that would be better
Anybody can email me at [email protected]
Edit: I just realized I put this in the wrong Github. Posted the issue in the AirGap wallet github.
Greetings.
This issue is related to airgap-it/airgap-wallet#55.
As the title suggests, I would like to implement BSC support into AirGap. As per #7, AirGap as a project prefers not to accumulate features that the maintainers cannot properly maintain, so I understand that my changes could end up not merged, which is fair considering the security centric approach of this project.
As per "Contribute Guidelines", I would like to know if there is interest in such a PR before implementing it?
It should be fairly easy as it is almost the same as Bitcoin BTC
Hi guys,
What's the process of adding a new blockchain into this?, I wanted to add another staking network .
I felt this wallet is good as your security is awesome.
let me know the steps
Thanks
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.