-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: bch * chore: ltc tx tests * chore: ltc & bch refactoring * chore: doge tx tests * chore: cleanup * feat: scrypta * refactor: sonar fixes Co-authored-by: Nick Papirniy <[email protected]>
- Loading branch information
Showing
144 changed files
with
2,525 additions
and
1,133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# TBD | ||
|
||
# Create library for new blockchain integration | ||
|
||
## EVM Based | ||
|
||
nx g @nrwl/js:library sdk-{BLOCKCHAIN_NAME} --directory=blockchain --simpleModuleName=true --buildable --publishable --importPath=@tatumio/{BLOCKCHAIN_NAME} --testEnvironment=node --tags=scope:sdk,scope:evm-based | ||
|
||
## Btc Based | ||
|
||
nx g @nrwl/js:library sdk-{BLOCKCHAIN_NAME} --directory=blockchain --simpleModuleName=true --buildable --publishable --importPath=@tatumio/{BLOCKCHAIN_NAME} --testEnvironment=node --tags=scope:sdk,scope:btc-based | ||
|
||
## Other (not evm and not btc) | ||
|
||
nx g @nrwl/js:library sdk-{BLOCKCHAIN_NAME} --directory=blockchain --simpleModuleName=true --buildable --publishable --importPath=@tatumio/{BLOCKCHAIN_NAME} --testEnvironment=node --tags=scope:sdk | ||
|
||
# Check workspace.json file to make sure module has correct name | ||
|
||
# Remove compilerOptions from packages/{BLOCKCHAIN_NAME}/tsconfig.json |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { REPLACE_ME_WITH_TATUM_API_KEY } from '@tatumio/shared-testing' | ||
import { TatumBchSDK } from '@tatumio/bch' | ||
import { BchTransaction } from '@tatumio/api-client' | ||
|
||
const bchSDK = TatumBchSDK({ apiKey: REPLACE_ME_WITH_TATUM_API_KEY }) | ||
|
||
export async function bchBlockchainExample() { | ||
const blockChainInfo = await bchSDK.blockchain.info() | ||
const block = await bchSDK.blockchain.getBlock( | ||
'0000000000000010da4dbada5440ec86dd74d0ade1920ac1897f9adcfe83f8b9', | ||
) | ||
const txHash = await bchSDK.blockchain.broadcast({ | ||
txData: '62BD544D1B9031EFC330A3E855CC3A0D51CA5131455C1AB3BCAC6D243F65460D', | ||
signatureId: '1f7f7c0c-3906-4aa1-9dfe-4b67c43918f6', | ||
}) | ||
const hash = await bchSDK.blockchain.getBlockHash(1580117) | ||
const tx = await bchSDK.blockchain.getTransaction( | ||
'1451692ebbfbea1a2d2ec6fe6782596b6aa2e46c0589d04c406f491b5b46bc6a', | ||
) | ||
const txByAddress = await bchSDK.blockchain.getTxForAccount('2MsM67NLa71fHvTUBqNENW15P68nHB2vVXb', 50) | ||
const transfer = await bchSDK.blockchain.send({ | ||
fromUTXO: [ | ||
{ | ||
txHash: '53faa103e8217e1520f5149a4e8c84aeb58e55bdab11164a95e69a8ca50f8fcc', | ||
index: 0, | ||
privateKey: 'cVX7YtgL5muLTPncHFhP95oitV1mqUUA5VeSn8HeCRJbPqipzobf', | ||
}, | ||
], | ||
to: [ | ||
{ | ||
address: '2MzNGwuKvMEvKMQogtgzSqJcH2UW3Tc5oc7', | ||
value: 0.02969944, | ||
}, | ||
], | ||
} as BchTransaction) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { REPLACE_ME_WITH_TATUM_API_KEY } from '@tatumio/shared-testing' | ||
import { TatumBtcSDK } from '@tatumio/btc' | ||
import { BtcTransactionFromAddress } from '@tatumio/api-client' | ||
|
||
const btcSDK = TatumBtcSDK({ apiKey: REPLACE_ME_WITH_TATUM_API_KEY }) | ||
|
||
export async function btcBlockchainExample() { | ||
const mempoolTransactionIds = await btcSDK.blockchain.mempool() | ||
const block = await btcSDK.blockchain.getBlock( | ||
'0000000000000000000067de34da54c96ff76e6ba172f82c4ed8a25afb112a9e', | ||
) | ||
const txHash = await btcSDK.blockchain.broadcast({ | ||
txData: '62BD544D1B9031EFC330A3E855CC3A0D51CA5131455C1AB3BCAC6D243F65460D', | ||
signatureId: '1f7f7c0c-3906-4aa1-9dfe-4b67c43918f6', | ||
}) | ||
const balance = await btcSDK.blockchain.getBlockchainAccountBalance('2MsM67NLa71fHvTUBqNENW15P68nHB2vVXb') | ||
const blockchainInfo = await btcSDK.blockchain.info() | ||
const hash = await btcSDK.blockchain.getBlockHash(1580117) | ||
const tx = await btcSDK.blockchain.getTransaction( | ||
'1451692ebbfbea1a2d2ec6fe6782596b6aa2e46c0589d04c406f491b5b46bc6a', | ||
) | ||
const txByAddress = await btcSDK.blockchain.getTransactionsByAddress( | ||
'2MsM67NLa71fHvTUBqNENW15P68nHB2vVXb', | ||
50, | ||
) | ||
const utxo = await btcSDK.blockchain.getUTXO( | ||
'53faa103e8217e1520f5149a4e8c84aeb58e55bdab11164a95e69a8ca50f8fcc', | ||
0, | ||
) | ||
const transfer = await btcSDK.blockchain.sendTransaction({ | ||
fromAddress: [ | ||
{ | ||
address: '2N9bBiH2qrTDrPCzrNhaFGdkNKS86PJAAAS', | ||
privateKey: 'cVX7YtgL5muLTPncHFhP95oitV1mqUUA5VeSn8HeCRJbP', | ||
}, | ||
], | ||
to: [ | ||
{ | ||
address: '2MzNGwuKvMEvKMQogtgzSqJcH2UW3Tc5oc7', | ||
value: 0.02969944, | ||
}, | ||
], | ||
} as BtcTransactionFromAddress) | ||
} |
Oops, something went wrong.