@ixily/activ-web
v4.10.23
Published
Alpha Capture Trade Idea Verification. Blockchain ownership proven trade ideas and strategies.
Downloads
578
Readme
Table of Contents
- Installation
- Creating Investment Ideas
- Adjusting Investment Ideas
- Closing Investment Ideas
- Retrieving Investment Ideas
- Retrieving Investment Strategies
- Provider Authorization (for enabling Copy Trade)
- Additional Methods
- BRA Methods
- License
Installation
Installation:
npm i @ixily/activ-web
Add in your main index.html this:
<script src="https://ixily.io/assets/js/jimp.min.js"></script>
Metamask
NOTE: Obviously you also need the web3 provider in your browser
npm i @metamask/[email protected]
Examples:
Go here to see and clone basic examples using activ: https://github.com/IXily
Basic initialization example:
You can install
import IXilyACTIV from '@ixily/activ-web';
const activ: IXilyACTIV;
(async main(){
try {
const webProvider = await detectEthereumProvider();
activ = new IXilyACTIV({
webProvider,
});
await activ.init({
ipfsProxyEnabled: true,
network: 'mumbai, // add your prefered helper to get the network value
showLogsToDebug: false,
});
} catch(err){
console.log('main error', err.message);
}
})();
Creating Investment Ideas
Create A New Investment Idea
import { v4 } from "@ixily/activ-web/dist/src"; const newIdea = { public: { title: "My new idea/nft", description: "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been", image: "data:image/svg+xml;base64,PCEtLSBieSBUcmFkaW5nVmlldyAtLT48c3ZnIHdpZHRoPSI1NiIgaGVpZ2h0PSI1NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjRjc5MzFBIiBkPSJNMCAwaDU2djU2SDB6Ii8+PHBhdGggZD0iTTM5LjkzNiAyNC43MDRjLjUxNS0zLjQ5NC0yLjEzLTUuMzU3LTUuNzczLTYuNjIybDEuMTgtNC43MDgtMi44NzctLjcxNi0xLjE0OCA0LjU5Mi0yLjI5Ni0uNTQ5IDEuMTY0LTQuNjI1LTIuODc4LS43MTUtMS4xODEgNC43MjUtMS44My0uNDMzdi0uMDE2bC0zLjk3Ni0uOTk5LS43NjYgMy4wNzhzMi4xMy41IDIuMDk2LjUxNmMxLjE2NS4zIDEuMzY1IDEuMDY1IDEuMzMyIDEuNjY0bC0xLjMzMiA1LjM5LjMuMS0uMzE2LS4wNjctMS44OCA3LjUzN2MtLjEzMy4zNS0uNS44ODItMS4zMTQuNjY1LjAzMy4wNS0yLjA4LS40OTktMi4wOC0uNDk5bC0xLjQzIDMuMjc4IDMuNzQzLjkzMSAyLjA0Ni41MzMtMS4xOTggNC43NzUgMi44NzguNzE1IDEuMTY1LTQuNzI1IDIuMzEyLjU5OS0xLjE4IDQuNzA4IDIuODc3LjcxNiAxLjE4MS00Ljc3NWM0LjkwOC45MzEgOC42MDIuNTY2IDEwLjE1LTMuODc3IDEuMjQ3LTMuNTc2LS4wNjctNS42MjMtMi42NDYtNi45ODcgMS44OC0uNDE2IDMuMjk0LTEuNjY0IDMuNjYtNC4yMWguMDE3em0tNi41NzIgOS4yMTdjLS44ODIgMy41NzctNi45MDQgMS42My04Ljg1IDEuMTY0bDEuNTgtNi4zMzhjMS45NDYuNDk5IDguMjAyIDEuNDQ3IDcuMjcgNS4xNTd2LjAxN3ptLjg4Mi05LjI2N2MtLjc5OSAzLjI0NC01LjgyMyAxLjU5Ny03LjQzNyAxLjE5OGwxLjQzLTUuNzRjMS42MzEuNCA2Ljg1NSAxLjE2NSA2LjAwNyA0LjU0MnoiIGZpbGw9IiNmZmYiLz48L3N2Zz4=", }, content: { reference: v4.generateUUID(), }, strategy: { reference: v4.generateUUID(), name: "Fake strategy", description: "Fake strategy just to test", creatorName: "Fake", image: "https://previews.123rf.com/images/varijanta/varijanta1601/varijanta160100039/51306453-thin-line-flat-design-banner-of-business-and-marketing-strategy-modern-vector-illustration-concept.jpg", }, creator: { name: "William Wallace", company: "WW Company", url: "https://en.wikipedia.org/wiki/William_Wallace", walletAddress: "0xaB31A127b112CcF2e97fC54A842A6a3b7070BEa9", }, access: { wallets: ["0x2767441E044aCd9bbC21a759fB0517494875092d"], }, idea: { kind: "open", asset: { ticker: "BTCUSDT", description: "BTC/USDT", }, trade: { conviction: 100, direction: "long", }, notes: { commentary: "This trade idea was opened just to test", }, }, pricing: { provider: "Binance", }, }; const data = await activ.createIdea(payload);
Adjusting Investment Ideas
Adjusting Inverstment Ideas
const adjustIdea = await activ.adjustIdea({ ticker: "BTCUSDT", strategyReference: "c407705a-6248-451d-bc12-fb7ebb43d05b", creatorWallet: "0xaB31A127b112CcF2e97fC54A842A6a3b7070BEa9", adjustment: { kind: "increase", percentage: 20, }, pricingCredentials: { provider: "Binance", auth: { key: "your_binance_key", }, }, notes: "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been...", });
Closing Investment Ideas
Closing Investment Ideas
const closeIdea = await activ.closeIdea({ ticker: "BTCUSDT", strategyReference: "c407705a-6248-451d-bc12-fb7ebb43d05b", creatorWallet: "0xaB31A127b112CcF2e97fC54A842A6a3b7070BEa9", pricingCredentials: { provider: "Binance", auth: { key: "your_binance_key", }, }, notes: "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been...", });
Retrieving Investment Ideas
- Retrieve all public ideas
const page = 1;
const limit = 10;
const data = await activ.getAllPublicIdeas(page, limit);
Retrieve the ideas created by the user wallet in session (used in your browser)
const page = 1; const limit = 10; const filter = ["open"]; // 'open', 'adjust', 'close' const data = await activ.getIdeasOwnedBy(page, limit, filter);
Retrieve the ideas with access by the user wallet in session (used in your browser)
const page = 1; const limit = 10; const filter = ["open"]; // 'open', 'adjust', 'close' const data = await activ.getIdeasClientBy(page, limit, filter);
Retrieve ideas by strategy
const strategyReference = "c407705a-6248-451d-bc12-fb7ebb43d05b"; const page = 1; const limit = 10; const filter = ["open"]; // 'open', 'adjust', 'close' const data = await activ.getIdeasByStrategy( strategyReference, page, limit, filter );
Retrieve closed ideas history by strategy
const data = await activ.getClosedIdeasHistoryByStrategy({ strategyReference: "c407705a-6248-451d-bc12-fb7ebb43d05b", stages: true, });
Retrieve NFT content/info by ID
const nftId = 10; const data = await activ.getIdeaByNftId(nftId);
Retrieving Investment Strategies
Retrieve all public strategies
const page = 1; const limit = 10; const data = await activ.getAllPublicStrategies(page, limit);
Retrieve the list of strategies created by the user wallet in session (used in your browser)
const page = 1; const limit = 10; const data = await activ.listMyStrategies(page, limit);
Retrieve the list of accesible strategies (strategies with permission/access)
const page = 1; const limit = 10; const data = await activ.listAccesibleStrategies(page, limit);
Retrieve the list of all strategies
const page = 1; const limit = 10; const data = await activ.listAllStrategies(page, limit);
Retrieve the list of all strategies by specific creator (wallet)
const creatorWallet = "0xaB31A127b112CcF2e97fC54A842A6a3b7070BEa9"; const type = "all"; // 'all' | 'my' | 'accesible' | 'public', const page = 1; const limit = 10; const data = await activ.listAllStrategiesByCreator( creatorWallet, type, page, limit );
Retrieve strategy info
const strategyReference = "c407705a-6248-451d-bc12-fb7ebb43d05b"; const data = await activ.getStrategyInfoDetails(strategyReference);
Provider Authorization (for enabling Copy Trade)
Authorize Provider
const providerAddress = "0xaB31A127b112CcF2e97fC54A842A6a3b7070BEa9"; await activ.authorizeProvider(providerAddress);
Revoke Provider
const providerAddress = "0xaB31A127b112CcF2e97fC54A842A6a3b7070BEa9"; await activ.revokeProvider(providerAddress);
Check Provider Authorization
const providerAddress = "0xaB31A127b112CcF2e97fC54A842A6a3b7070BEa9"; const data = await activ.authorizeCheck(providerAddress);
Create an Idea/NFT in the name of another user (i.e. the provider can create the nft if the client used the method on: - Authorize Provider)
const client = '0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC'; const newIdea = {...} // content used like: - Create a new Idea/NFT const data = await activ.providerCreateIdea(client, newIdea);
Additional Methods
Retrieve wallet info details
const userWallet = "0xaB31A127b112CcF2e97fC54A842A6a3b7070BEa9"; const data = await activ.getWalletInfoDetails(userWallet);
Post mint granting of access/permission to an idea
const nftId = 10; const walletAddresses = ["0x023C04DB0Deb586F32444A4e154596094c52E7Da"]; await activ.giveIdeaAccessTo(nftId, walletAddresses);
Retrieve wallet with access/permission to an idea
const nftId = 10; const data = await activ.getIdeaViewers(nftId);
Search asset
const payload = { provider: "Binance", auth: { key: "123", secret: "456", // optional }, params: { symbol: "BTCUSDT", }, }; const data = await activ.getPricingAsset(payload);
Reset Cache
// content: strategy and idea await activ.resetCache("idea"); await activ.resetCache("strategy");
Retrieve estimated costs to create an NFT
const newIdea = true; const data = await activ.getEstimatedCosts(newIdea);
Check if a wallet address is valid
const walletAddressList = ["0xaB31A127b112CcF2e97fC54A842A6a3b7070BEa9"]; const data = await activ.isValidWalletAddress(walletAddressList);
BRA Methods
What do I need to use the BRA methods?
To use the BRA methods you need be authorized for this reason you need generate your own apiKey, steps to get:
- Go here: https://ixily.io/activ/account/profile
- Click to the "API KEYS" section (left menu)
- Copy and pass in the method to call
- Done!
Create A New Investment Idea
import { v4 } from "@ixily/activ"; const apiKey = "your_api_key"; const newIdea = { public: { title: "My new idea/nft", description: "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been", image: "data:image/svg+xml;base64,PCEtLSBieSBUcmFkaW5nVmlldyAtLT48c3ZnIHdpZHRoPSI1NiIgaGVpZ2h0PSI1NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjRjc5MzFBIiBkPSJNMCAwaDU2djU2SDB6Ii8+PHBhdGggZD0iTTM5LjkzNiAyNC43MDRjLjUxNS0zLjQ5NC0yLjEzLTUuMzU3LTUuNzczLTYuNjIybDEuMTgtNC43MDgtMi44NzctLjcxNi0xLjE0OCA0LjU5Mi0yLjI5Ni0uNTQ5IDEuMTY0LTQuNjI1LTIuODc4LS43MTUtMS4xODEgNC43MjUtMS44My0uNDMzdi0uMDE2bC0zLjk3Ni0uOTk5LS43NjYgMy4wNzhzMi4xMy41IDIuMDk2LjUxNmMxLjE2NS4zIDEuMzY1IDEuMDY1IDEuMzMyIDEuNjY0bC0xLjMzMiA1LjM5LjMuMS0uMzE2LS4wNjctMS44OCA3LjUzN2MtLjEzMy4zNS0uNS44ODItMS4zMTQuNjY1LjAzMy4wNS0yLjA4LS40OTktMi4wOC0uNDk5bC0xLjQzIDMuMjc4IDMuNzQzLjkzMSAyLjA0Ni41MzMtMS4xOTggNC43NzUgMi44NzguNzE1IDEuMTY1LTQuNzI1IDIuMzEyLjU5OS0xLjE4IDQuNzA4IDIuODc3LjcxNiAxLjE4MS00Ljc3NWM0LjkwOC45MzEgOC42MDIuNTY2IDEwLjE1LTMuODc3IDEuMjQ3LTMuNTc2LS4wNjctNS42MjMtMi42NDYtNi45ODcgMS44OC0uNDE2IDMuMjk0LTEuNjY0IDMuNjYtNC4yMWguMDE3em0tNi41NzIgOS4yMTdjLS44ODIgMy41NzctNi45MDQgMS42My04Ljg1IDEuMTY0bDEuNTgtNi4zMzhjMS45NDYuNDk5IDguMjAyIDEuNDQ3IDcuMjcgNS4xNTd2LjAxN3ptLjg4Mi05LjI2N2MtLjc5OSAzLjI0NC01LjgyMyAxLjU5Ny03LjQzNyAxLjE5OGwxLjQzLTUuNzRjMS42MzEuNCA2Ljg1NSAxLjE2NSA2LjAwNyA0LjU0MnoiIGZpbGw9IiNmZmYiLz48L3N2Zz4=", }, content: { reference: v4.generateUUID(), }, strategy: { reference: v4.generateUUID(), name: "Fake strategy", description: "Fake strategy just to test", creatorName: "Fake", image: "https://previews.123rf.com/images/varijanta/varijanta1601/varijanta160100039/51306453-thin-line-flat-design-banner-of-business-and-marketing-strategy-modern-vector-illustration-concept.jpg", }, creator: { name: "William Wallace", company: "WW Company", url: "https://en.wikipedia.org/wiki/William_Wallace", walletAddress: "0xaB31A127b112CcF2e97fC54A842A6a3b7070BEa9", }, access: { wallets: ["0x2767441E044aCd9bbC21a759fB0517494875092d"], }, idea: { kind: "open", asset: { ticker: "BTCUSDT", description: "BTC/USDT", }, trade: { conviction: 100, direction: "long", }, notes: { commentary: "This trade idea was opened just to test", }, }, pricing: { provider: "Binance", }, }; const activ = await ActivModule.getApi(); const data = await activ.createIdeaFromFiatMint(payload, apiKey);
Adjusting Inverstment Ideas
const activ = await ActivModule.getApi(); const apiKey = 'your_api_key'; const adjustIdea = await activ.adjustIdeaFromFiatMint( { ticker: 'BTCUSDT', strategyReference: 'c407705a-6248-451d-bc12-fb7ebb43d05b', creatorWallet: '0xaB31A127b112CcF2e97fC54A842A6a3b7070BEa9', adjustment: { kind: 'increase', percentage: 20 }, pricingCredentials: { provider: 'Binance', auth: { key: 'your_binance_key', } }, notes: 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been...', }, apiKey });
Closing Investment Ideas
const activ = await ActivModule.getApi(); const apiKey = 'your_api_key'; const closeIdea = await activ.closeIdeaFromFiatMint( { ticker: 'BTCUSDT', strategyReference: 'c407705a-6248-451d-bc12-fb7ebb43d05b', creatorWallet: '0xaB31A127b112CcF2e97fC54A842A6a3b7070BEa9', pricingCredentials: { provider: 'Binance', auth: { key: 'your_binance_key', } }, notes: 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been...', }, apiKey });
License
ACTIV is licensed under the MIT license. Open Sans is licensed under the Apache license