Zebec Network 백서

Zebec Network

원문

bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 20쪽 중 15쪽

et started . This will deduct token from your main wallet to Zebec wallet. ![](https://3427593773-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYaTRWumFGJjYtG8IAVar%2Fuploads%2FBhARwNfB0yOJaNJJSwvU%2Fimage.png?alt=media\&token=4ee79211-ed67-4b3d-965c-c5ce5dd6307c) # Start Streaming You can start streaming to the receiver for this you should have tokens in your zebec wallet .This will start streaming the token as per selected time.You can even pause , resume , cancel the stream. ![](https://3427593773-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYaTRWumFGJjYtG8IAVar%2Fuploads%2Fcj5CTkiSqff1mycbgBax%2Fimage.png?alt=media\&token=87934f65-09ca-40c0-b095-da0d8b90364b) # Withdraw Funds There are two kinds of withdrawal currently in Zebec. - Withdrawing balance you deposit into Zebec so that you can fund outgoing transactions - Withdrawing balance you received from other people ### Withdraw Incoming Funds Withdrawing streamed token is easy. Just go to your incoming tab. Select the stream you want to withdraw funds from. Select the “Actions” menu, select “Withdraw.” ![](https://3427593773-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYaTRWumFGJjYtG8IAVar%2Fuploads%2FTiQAJn7m2qEd4vL0A8aI%2Fimage.png?alt=media\&token=c71c925e-aad7-4f23-adaa-427598601e99) Next, enter your withdrawal amount. ![](https://3427593773-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYaTRWumFGJjYtG8IAVar%2Fuploads%2FebozNycYVvP5WcpPdlw7%2Fimage.png?alt=media\&token=d9b8ad09-42a8-407a-b599-8d137c552f4b) Streamed Token = The amount of money streamed in that transaction. Max Withdrawable Token = The amount of money that can be withdrawn from the transaction. Enter your desired amount. You can enter the maximum amount to withdraw. If for some reason the maximum value does not work, please enter a few decimals less than the maximum value. For example, instead of 10, you enter 9.99 or 9.98. That should get the job done. The remaining amount is still remaining in your account for future withdrawals. ### Withdrawing Deposited Token Go to your Zebec dashboard and click “Withdraw‘ button at the top in the navigation bar. ![](https://3427593773-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYaTRWumFGJjYtG8IAVar%2Fuploads%2FiMwxewvjDuamZENWmqkt%2Fimage.png?alt=media\&token=f487d3c3-a3ab-4a81-8853-8cb510b2283e) Select your desired token and enter the desired amount. ![](https://3427593773-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYaTRWumFGJjYtG8IAVar%2Fuploads%2Fe5M5T3CRbgChCzpmZWoF%2Fimage.png?alt=media\&token=f93ed3e9-132d-4d13-a8d4-00dd2dcfd08e) Press Withdraw and proceed with your transaction. \ Note : Sender should have enough token to stream you. If sender cancels the stream , the token will be directly deposited to the main wallet of receiver.i.e receiver should not click on withdraw button in case of cancellation. If you have more questions, please ask at #support-zebec in our Discord. <https://discord.com/invite/fJM9cHuvvB> # Safe Learn how you can manage multisig transactions using Zebec. Zebec implements Gnosis Safe for multi-sig transactions, you can manage your Safe in three ways/operations. **Safe Operations:** [1) Create Safe](/zebec-network-archive/zebec-network-archive/safe/create-safe) [2) Deposit Funds in Safe](/zebec-network-archive/zebec-network-archive/safe/deposit-in-safe) [3) Streaming and Zapps Transactions](/zebec-network-archive/zebec-network-archive/safe/sending-a-transaction) # Create Safe To make use of the multi-signature transactions feature, you need to create a safe. Creating a safe can be achieved by following these steps: 1\) Look for the "Accounts" option in the Zebec Dashboard. Within the "Accounts" section, you will see a list of options. Among these options, you should find one labeled "Safe" <figure><img src="https://3427593773-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYaTRWumFGJjYtG8IAVar%2Fuploads%2Fj7IaOKL3l5ao9VZsSlx0%2Fimage.png?alt=media&amp;token=b4ea82c0-9928-43ca-a51c-d94b76123761" alt=""><figcaption><p>Zebec BNB Dashboard</p></figcaption></figure> 2\) Click on Create Safe to create a new safe <figure><img src="https://3427593773-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYaTRWumFGJjYtG8IAVar%2Fuploads%2FcjRv50PrN3GS7mfP5Qcv%2Fimage.png?alt=media&amp;token=5a9e06ce-0b43-422b-aaf5-c38be3391ae4" alt=""><figcaption></figcaption></figure> 3\) To create your Safe, provide a name for it and continue. <figure><img src="https://3427593773-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYaTRWumFGJjYtG8IAVar%2Fuploads%2FbuZWMYGmZ8M8ugW1Jmoi%2Fimage.png?alt=media&amp;token=7e5f9a99-e0c2-49ec-b52d-0de12b2a5fbd" alt=""><figcaption></figcaption></figure> 4\) Add the signer's addresses who would be signing transactions from the safe and the minimum number of confirmations required for any transactions <figure><img src="https://3427593773-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYaTRWumFGJjYtG8IAVar%2Fuploads%2FR6eAvBCqBQTYezOziIpJ%2Fimage.png?alt=media&amp;token=068b7948-0034-4e23-8ecc-dce6990649c0" alt=""><figcaption></figcaption></figure> 5\) Click Confirm and your multisig safe will be created. <figure><img src="https://3427593773-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYaTRWumFGJjYtG8IAVar%2Fuploads%2FBKSWg39EEYo4uCvD5JxH%2Fimage.png?alt=media&amp;token=8eb6ab02-ea5a-4538-a947-e2ead8f8acb5" alt=""><figcaption></figcaption></figure> 6\) Safe has been created, You can now deposit funds and use it to initiate streaming and Zapps transaction <figure><img src="https://3427593773-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYaTRWumFGJjYtG8IAVar%2Fuploads%2FBwBzdlSXVlEUpqMfKhhj%2Fimage.png?alt=media&amp;token=46c5db23-f997-470c-b488-d971a538ed1a" alt=""><figcaption></figcaption></figure> # Deposit in Safe Funds can be deposited by any owner. This money will be deducted from the owner's Zebec wallet or Metamask wallet. You can deposit funds into the Safe wallet from either your MetaMask wallet or your Zebec wallet. <figure><img src="https://3427593773-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYaTRWumFGJjYtG8IAVar%2Fuploads%2FmmaodHMv8ERZHciXgzu6%2Fimage.png?alt=media&amp;token=ee79ccb4-cf2e-4819-9d82-761ad17a64fc" alt=""><figcaption><p>Desposit from Metamask Wallet</p></figcaption></figure> <figure><img src="https://3427593773-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYaTRWumFGJjYtG8IAVar%2Fuploads%2FcibO4c9OoR9VgWyCKCRw%2Fimage.png?alt=media&amp;token=955630e6-dfee-4ba7-bd16-94624a73fdfa" alt=""><figcaption><p>Deposit from Zebec Wallet</p></figcaption></figure> # Sending a Transaction Initiating a Streaming Transaction from Safe Any owner can initiate a transaction from the safe. To initiate a transaction account owner should follow the following steps. 1\) Look for the "Send Stream" button in the Zebec Dashboard. Among the Options, Select the Safe you want to transact from <figure><img src="https://3427593773-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYaTRWumFGJjYtG8IAVar%2Fuploads%2FHZR1JJdRusVMUAZXU83O%2Fimage.png?alt=media&amp;token=d73a96ef-41d8-425c-8c7a-0658d796491b" alt=""><figcaption></figcaption></figure> 2\) Fill up the details of the transaction and sign to initiate it. <img src="https://3427593773-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYaTRWumFGJjYtG8IAVar%2Fuploads%2F0gKjxS9eR6OhTivkb4z3%2Fimage.png?alt=media&amp;token=69a85475-98f4-4a97-8a7c-a2a85d1de87c" alt="" data-size="original"> 3\) Number of the owner accounts should sign the transaction in order to begin streaming. # Zapps Safe funds can also be applied to various Zaaps. Zebec Safe has integrated various applications known as Zapps. You can utilize these Zapps within the Safe by following these easy steps. 1\) Look for the "Zapps" tab in the Safe tab list. You will be directed to Zapps list <figure><img src="https://3427593773-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYaTRWumFGJjYtG8IAVar%2Fuploads%2F2Ur6wgiQ6XUBCBQ3Ftvo%2Fimage.png?alt=media&amp;token=5a7b09bb-00d0-4f5c-8373-17eceb856e48" alt=""><figcaption></figcaption></figure> <figure><img src="https://3427593773-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYaTRWumFGJjYtG8IAVar%2Fuploads%2FIkMLGntTeKrJVXuxVrwG%2Fimage.png?alt=media&amp;token=c6730bbd-d0a3-4965-932c-6b7d7665c924" alt=""><figcaption></figcaption></figure> 2\) Choose a Zapp you want to use <figure><img src="https://3427593773-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYaTRWumFGJjYtG8IAVar%2Fuploads%2FycSCrhNDlGcLJYd2D78u%2Fimage.png?alt=media&amp;token=13487a5e-42c1-49c0-9cc1-bf167fd95fb3" alt=""><figcaption></figcaption></figure> 3\) You will be directed to the Zapp you have chosen <figure><img src="https://3427593773-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYaTRWumFGJjYtG8IAVar%2Fuploads%2Fn3YyBlkiidKiiyeZS9TV%2Fimage.png?alt=media&amp;token=6dcad940-87a5-4e53-b015-c63f5436f477" alt=""><figcaption></figcaption></figure> 4\) After the transaction is initiated, a number of owner accounts must sign the transaction before the transaction is approved # Signing a Transaction Approving a transaction To confirm a safe transaction, a threshold number of owners must sign the transaction. To sign a transaction, we can 1\) Select a transaction from the safe transaction list. 2\) Click sign transaction. When a number of owner accounts sign the transaction, the transaction will be approved. # Zebec Solana Sdk # Streaming This is the most advanced SDK for implementation. Find here : Program ID : \`zbcKGdAmXfthXY3rEPBzexVByT2cqRqCZb9NwWdGQ2T\` This is Zebec's normal stream version 2, which includes new features. * Solana wallet adapter support. * With proper error handling. * Based on anchor framework. * Easy to implement. # Initialize Zebec Stream To create a Zebec Stream service, we would need to initialize the anchor provider and fee receiver. ``` const provider = initAnchorProvider(wallet, RPC_URL); ``` ``` const native = new ZebecNativeStream(provider, feeReceiverAddress); ``` ``` const token = new ZebecTokenStream(provider, feeReceiverAddress); ``` # Create Fee Vault Add fee percentage . ``` const response = await ZebecStream.createFeeVault({ fee_percentage : 2.5 }) ``` # Update Fee Vault ``` const response = await ZebecStream.updateFeeVault({ fee_percentage: 2.5 }); ``` # Collect Fees The total collected fee can be withdrawn from the account owner. In the case of SPL tokens, simply enter the token mint address. ``` // Native token const response = await ZebecStream.collectSolFees(); // SPL token const response = await ZebecStream.collectTokenFees({ token_mint_address: 'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB' ; }); ``` # Deposit Deposit functions creates associated address with program id and creates an address , which we called zebec wallet. Funds are deposited in this vault. ``` // Native Token const response = await native.deposit({ sender: 'Av6xsgSrnM1UAj4pUZnEWM97iBphph69NPHE8J2ceeYs', //signer amount: 1, }); console.log(response); ``` ``` // SPL Token const response = await token.deposit({ sender: 'Av6xsgSrnM1UAj4pUZnEWM97iBphph69NPHE8J2ceeYs', token_mint_address:'zebeczgi5fSEtbpfQKVZKCJ3WgYXxjkMUkNNx7fLKAF', amount: 1, }); console.log(response); ``` # Withdraw Deposited Token This function withdraw the amount from zebec wallet and deposit to the main signers wallet. ``` // Native Token const response = await native.instantTransfer({ sender: 'Av6xsgSrnM1UAj4pUZnEWM97iBphph69NPHE8J2ceeYs, receiver: 'Av6xsgSrnM1UAj4pUZnEWM97iBphph69NPHE8J2ceeYs' amount: 1, }); ``` ``` // SPL Token const response = await token.instantTransfer({ sender: 'Av6xsgSrnM1UAj4pUZnEWM97iBphph69NPHE8J2ceeYs, token_mint_address: 'zebeczgi5fSEtbpfQKVZKCJ3WgYXxjkMUkNNx7fLKAF', receiver: 'Av6xsgSrnM1UAj4pUZnEWM97iBphph69NPHE8J2ceeYs', amount: 1, }); ``` # Start Streaming Start streaming helps to initiate the stream , for this user should decide start time , end time , amount and receiver before streaming and pass parameters as : ``` // Native Token const response = stream.init({ sender: "sender_wallet_address", receiver: "receiver_wallet_address", start_time: unixtimestamp, end_time: unixtimestamp, amount: <amount in SOL> }) ``` ``` // SPL Token const response = await token.init({ sender: 'J75jd3kjsABQSDrEdywcyhmbq8eHDowfW9xtEWsVALy9', receiver: "Av6xsgSrnM1UAj4pUZnEWM97iBphph69NPHE8J2ceeYs", start_time: Math.floor(Date.now() / 1000) + 80, end_time: Math.floor(Date.now() / 1000) + 150, amount: 0.5, token_mint_address:'zebeczgi5fSEtbpfQKVZKCJ3WgYXxjkMUkNNx7fLKAF', }); console.log(response); ``` {% hint style="info" %} Note: Returned PDA 'escrow' should be saved for using stream methods: pause, resume, and, withdraw the streamed token. {% endhint %} # Pause Stream Pause function stops the stream. After this, it will long as user will not resume this . In case the end time is crossed and stream is not resumed stream will be canceled and only the streamed amount will be withdraw able. ``` // Native Token const response = await native.pause({ sender: 'J75jd3kjsABQSDrEdywcyhmbq8eHDowfW9xtEWsVALy9', receiver: "Av6xsgSrnM1UAj4pUZnEWM97iBphph69NPHE8J2ceeYs", escrow: "3FUiFXgde4EUsk9gJKxmSh11YN2z7KEW47TErGV8yidk", }); console.log(response.message); ``` ``` // SPL Token const response = await token.pause({ sender: 'J75jd3kjsABQSDrEdywcyhmbq8eHDowfW9xtEWsVALy9', receiver: "Av6xsgSrnM1UAj4pUZnEWM97iBphph69NPHE8J2ceeYs", escrow: "3FUiFXgde4EUsk9gJKxmSh11YN2z7KEW47TErGV8yidk", token_mint_address:'zebeczgi5fSEtbpfQKVZKCJ3WgYXxjkMUkNNx7fLKAF', }); console.log(response.message); ``` # Resume Stream ``` // Native Token const response = await native.resume({ sender: 'J75jd3kjsABQSDrEdywcyhmbq8eHDowfW9xtEWsVALy9', receiver: "Av6xsgSrnM1UAj4pUZnEWM97iBphph69NPHE8J2ceeYs", escrow: "3FUiFXgde4EUsk9gJKxmSh11YN2z7KEW47TErGV8yidk", }); console.log(response.message); ``` ``` // SPL Token const response = await token.resume({ sender: 'J75jd3kjsABQSDrEdywcyhmbq8eHDowfW9xtEWsVALy9', receiver: "Av6xsgSrnM1UAj4pUZnEWM97iBphph69NPHE8J2ceeYs", escrow: "3FUiFXgde4EUsk9gJKxmSh11YN2z7KEW47TErGV8yidk", token_mint_address:'zebeczgi5fSEtbpfQKVZKCJ3WgYXxjkMUkNNx7fLKAF', }); console.log(response.message); ``` {% hint style="info" %} Note : Resume will not work if end time of transaction is crossed. {% endhint %} # Cancel Stream Cancel stream helps the sender to cancel the stream whenever they want within stream period. ``` // Native Token const response = await native.cancel({ sender: 'J75jd3kjsABQSDrEdywcyhmbq8eHDowfW9xtEWsVALy9', receiver: "Av6xsgSrnM1UAj4pUZnEWM97iBphph69NPHE8J2ceeYs", escrow: "3FUiFXgde4EUsk9gJKxmSh11YN2z7KEW47TErGV8yidk", }); console.log(response.message); ``` ``` // SPL Token const response = await token.cancel({ sender: 'J75jd3kjsABQSDrEdywcyhmbq8eHDowfW9xtEWsVALy9', receiver: "Av6xsgSrnM1UAj4pUZnEWM97iBphph69NPHE8J2ceeYs", escrow: "3FUiFXgde4EUsk9gJKxmSh11YN2z7KEW47TErGV8yidk", token_mint_address:'zebeczgi5fSEtbpfQKVZKCJ3WgYXxjkMUkNNx7fLKAF', }); console.log(response.message); ``` {% hint style="info" %} Note: You can cancel the scheduled transaction before the start time reaches. {% endhint %} # Withdraw Streamed Token To withdraw the streamed token this function is useful. In this function only the receiver is signer i.e only the receiver can withdraw the token. ``` // Native Token const response = await native.withdraw({ sender: "J75jd3kjsABQSDrEdywcyhmbq8eHDowfW9xtEWsVALy9", receiver: "Av6xsgSrnM1UAj4pUZnEWM97iBphph69NPHE8J2ceeYs", escrow: "FMBLNb3KD1u4pXhDzQQAqVanEqu6yCsD2wMjdARFbbtK", }); console.log(response.message); ``` ``` // SPL Token const response = await token.withdraw({ sender: "J75jd3kjsABQSDrEdywcyhmbq8eHDowfW9xtEWsVALy9", receiver: "Av6xsgSrnM1UAj4pUZnEWM97iBphph69NPHE8J2ceeYs", esrow: "FMBLNb3KD1u4pXhDzQQAqVanEqu6yCsD2wMjdARFbbtK", token_mint_address:'zebeczgi5fSEtbpfQKVZKCJ3WgYXxjkMUkNNx7fLKAF', }); console.log(response.message); ``` # Silver Card Sdk The Zebec Card SDK allows developers to integrate the functionality of purchasing and managing Zebec virtual cards into their applications. We currently support EVM chains (Ethereum, Binance Smart Chain (BSC), and Base) and Bittensor Network with the flexibility to toggle between mainnet and testnet environments based on configuration. # Installation Install the Zebec Card SDK via npm ```sh npm i @zebec-fintech/silver-card-sdk ``` # Quick Start To get started, create an instance of ZebecCardService for EVM compatible networks or ZebecCardTAOService for Bittensor Network. This instance requires a signer, a chain ID (for EVM only), and configu {% hint style="info" %} **Note**: Testnets (e.g., Sepolia, BSC Testnet) can only be used if `sandbox` mode is enabled. {% endhint %} Example: For EVM compatible networks: ```javascript import { ethers } from 'ethers'; import { ZebecCardService, Recipient, CountryCode } from '@zebec-fintech/silver-card-sdk'; const signer: ethers.Signer = ... ; // Signer instance from Wallet Extension const chainId = 11155111; // Sepolia testnet const apiKey = process.env.API_KEY!; const encryptionKey = process.env.ENCRYPTION_KEY!; const service = new ZebecCardService( signer, chainId, { apiKey, encryptionKey, }, { sandbox: true, // Set to true for development or testing }, ); ``` For Bittensor Network: ```javascript import { ZebecCardTAOService } from '@zebec-fintech/silver-card-sdk'; const signer: <Keyring | Signer> = ... ; // Keyring or Signer instance from Wallet Extension const service = new ZebecCardTAOService( signer, { apiKey, encryptionKey, }, { sandbox: true, // Set to true for development or testing }, ); ``` # Fetch Quote The fetchQuote method retrieves a quote for the specified amount in USD. The quote is used to calculate the corresponding token amount required for the card purchase. It expires in about 30 seconds. Code Example: ```javascript const amount = "150.55"; // Amount in USD const quote = await service.fetchQuote(amount); ``` Response: The `fetchQuote` method returns a quote object with the following fields: * **id**: Unique quote identifier. * **token**: Name or symbol of the token used to purchase the card. (e.g., `"USDC"`, `"TAO"`) * **targetCurrency**: Currency code for the amount. (e.g., `"USD"`) * **amountRequested**: Amount of USD the card is being purchased for. * **pricePerUnitCurrency**: Price of the token per unit USD. * **totalPrice**: Total token amount needed for purchase. * **platformFee**: Any additional fees charged by the platform. * **expiresIn**: Time in milliseconds before the quote expires. * **timestamp**: Timestamp when the quote was generated. * **status**: Quote status. #### Purchase Card The `purchaseCard` method initiates a virtual card purchase. It performs four main operations: 1. Approves token spending to the ZebecCard smart contract. (ERC20 tokens only) 2. Deposits tokens into the user's Zebec vault. 3. Initiates the card purchase on-chain. (ERC20 tokens only) 4. Posts transaction data, along with metadata, to the Zebec backend. The method returns a tuple with responses from each stage of the process. **Code Example** For EVM compatible networks: ```javascript const participantId = "JohnChamling"; const firstName = "John"; const lastName = "Chamling"; const emailAddress = "user@example.com"; const mobilePhone = "+91 012345678"; const language = "en-US"; const city = "Bharatpur"; const state = "Bagmati"; const postalCode = "44200"; const countryCode: CountryCode = "NPL"; const address1 =
프로젝트로 돌아가기