Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

顯示 tidebit event 資料於報表中 #51

Open
gibbs-shih opened this issue Apr 8, 2024 · 5 comments
Open

顯示 tidebit event 資料於報表中 #51

gibbs-shih opened this issue Apr 8, 2024 · 5 comments
Assignees
Labels
8 enhancement New feature or request

Comments

@gibbs-shih
Copy link
Contributor

gibbs-shih commented Apr 8, 2024

目標:以現有格式顯示 report 報表, 目前格式沒有的先給假資料

  • 待改成用 for loop 執行 i * 100 + 1, 先到 i = 100,000
@gibbs-shih gibbs-shih added enhancement New feature or request 8 labels Apr 8, 2024
@gibbs-shih gibbs-shih self-assigned this Apr 8, 2024
@gibbs-shih
Copy link
Contributor Author

  • 完成 auto_deploy_register_all_handlers.js 自動部署目前現有的 events
  • events:[ "E00010001", "E00010002", "E00010003", "E00010004", "E00010005", "E00010006", "E00010007", "E00010008", "E00020001", "E00020002", "E00020003", "E00020004", "E00020005", "E00020006", "E00020007", "E00020008", "E00020009", "E00020010", "E00020011", "E00020012", "E00030001", "E00030002", "E00030003", "E00030004", "E00030005", "E00030006", "E00030007", "E00030008", "E00040001", "E00040002", "E00040003", "E00040004", "E00040005", "E00040006" ]
  • 執行完 npx hardhat run src/services/blockchain/scripts/1.deploy.js --network iSunCoin 後執行 npx hardhat run src/services/blockchain/scripts/auto_deploy_register_all_handlers.js
    CleanShot 2024-04-12 at 16 18 06
    CleanShot 2024-04-12 at 16 18 52
    CleanShot 2024-04-12 at 16 39 58
    CleanShot 2024-04-12 at 16 40 42

@gibbs-shih
Copy link
Contributor Author

  • 執行 npx hardhat run src/services/blockchain/scripts/event_crawler_auto.js --network iSunCoin
  • 爬取 https://tidebit.baifa.io/api/v1/events?beginId=1 資料上鍊
  • E999999 略過, 有更新或不完整的 event 也會略過
  • 成功上鏈的 event 會有下面訊息
    CleanShot 2024-04-12 at 16 48 21
  • 爬完這頁會出現
    CleanShot 2024-04-12 at 16 59 39

@gibbs-shih
Copy link
Contributor Author

  • 執行 npx hardhat run src/services/blockchain/scripts/5.set_rate.js --network iSunCoin
  • 接著輸入:
    0x0000000000000000000000000000000000000000000000000dbd2fc137a30000,0x000000000000000000000000000000000000000000000056bc75e2d631000000,0x000000000000000000000000000000000000000000000581767ba6189c400000,0x66697273745f7265706f72740000000000000000000000000000000000000000
    • param 1 --> SP002 匯率轉換:1 USDT = 0.99 USD
    • param 2 --> SP003 匯率轉換:1 ETH = 1600 USD
    • param 3 --> SP004 匯率轉換: BTC = 26000 USD
    • param 4 --> report name : 這裡是 first_report 轉換

CleanShot 2024-04-12 at 17 10 50

@gibbs-shih
Copy link
Contributor Author

  • 執行 npx hardhat run src/services/blockchain/scripts/6.set_time_span.js --network iSunCoin

  • 接著輸入 1498435200,1498521599,0x66697273745f7265706f72740000000000000000000000000000000000000000

  • 以 2017/6/26 00:00:00 - 2017/6/26 23:59:59 一整天為例

    • start:1498435200
    • end:1498521599
      CleanShot 2024-04-12 at 17 19 54
  • 會 mintNFT
    CleanShot 2024-04-12 at 17 29 37

@gibbs-shih
Copy link
Contributor Author

  • db evidences content 會出現這一天 report
  • 數字正確性待檢驗
CleanShot 2024-04-12 at 17 33 46@2x
{
  "balanceSheet": {
    "reportID": "1",
    "reportName": "first_report",
    "reportStartTime": 1498435200,
    "reportEndTime": 1498521599,
    "reportType": "balance sheet",
    "totalAssetsFairValue": "50701.999999999995805696",
    "totalLiabilitiesAndEquityFairValue": "50701.999999999995805696",
    "assets": {
      "fairValue": "50701.999999999995805696",
      "details": {
        "cryptocurrency": {
          "fairValue": "452.0",
          "breakdown": {
            "USDT": {
              "amount": "0.0",
              "fairValue": "0.0"
            },
            "ETH": {
              "amount": "0.12",
              "fairValue": "192.0"
            },
            "BTC": {
              "amount": "0.01",
              "fairValue": "260.0"
            }
          }
        },
        "cashAndCashEquivalent": {
          "fairValue": "50249.999999999995805696",
          "breakdown": {
            "USD": {
              "amount": "50249.999999999995805696",
              "fairValue": "50249.999999999995805696"
            }
          }
        },
        "accountsReceivable": {
          "fairValue": "0.0",
          "breakdown": {
            "USDT": {
              "amount": "0.0",
              "fairValue": "0.0"
            },
            "BTC": {
              "amount": "0.0",
              "fairValue": "0.0"
            },
            "ETH": {
              "amount": "0.0",
              "fairValue": "0.0"
            }
          }
        }
      }
    },
    "nonAssets": {
      "fairValue": "0.0"
    },
    "liabilities": {
      "fairValue": "50701.999999999995805696",
      "details": {
        "userDeposit": {
          "fairValue": "44444.999999999995805696",
          "breakdown": {
            "USDT": {
              "amount": "0.0",
              "fairValue": "0.0"
            },
            "USD": {
              "amount": "44772.999999999995805696",
              "fairValue": "44772.999999999995805696"
            },
            "ETH": {
              "amount": "0.12",
              "fairValue": "192.0"
            },
            "BTC": {
              "amount": "-0.02",
              "fairValue": "-520.0"
            }
          }
        },
        "accountsPayable": {
          "fairValue": "6257.0",
          "breakdown": {
            "USDT": {
              "amount": "0.0",
              "fairValue": "0.0"
            },
            "USD": {
              "amount": "0.0",
              "fairValue": "5477.0"
            },
            "BTC": {
              "amount": "0.03",
              "fairValue": "780.0"
            },
            "ETH": {
              "amount": "0.0",
              "fairValue": "0.0"
            }
          }
        }
      }
    },
    "equity": {
      "fairValue": "0.0",
      "details": {
        "retainedEarning": {
          "fairValue": "0.0",
          "breakdown": {
            "USDT": {
              "amount": "0.0",
              "fairValue": "0.0"
            },
            "ETH": {
              "amount": "0.0",
              "fairValue": "0.0"
            },
            "BTC": {
              "amount": "0.0",
              "fairValue": "0.0"
            },
            "USD": {
              "amount": "0.0",
              "fairValue": "0.0"
            }
          }
        },
        "otherCapitalReserve": {
          "fairValue": "0.0",
          "breakdown": {
            "USD": {
              "amount": "0.0",
              "fairValue": "0.0"
            },
            "USDT": {
              "amount": "0.0",
              "fairValue": "0.0"
            },
            "ETH": {
              "amount": "0.0",
              "fairValue": "0.0"
            },
            "BTC": {
              "amount": "0.0",
              "fairValue": "0.0"
            }
          }
        }
      }
    }
  },
  "comprehensiveIncome": {
    "reportType": "comprehensive income",
    "reportID": "1",
    "reportName": "first_report",
    "reportStartTime": 1498435200,
    "reportEndTime": 1498521599,
    "netProfit": "0.0",
    "income": {
      "weightedAverageCost": "0.0",
      "details": {
        "depositFee": {
          "weightedAverageCost": "0.0",
          "breakdown": {
            "USDT": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            },
            "ETH": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            },
            "BTC": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            },
            "USD": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            }
          }
        },
        "withdrawalFee": {
          "weightedAverageCost": "0.0",
          "breakdown": {
            "USDT": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            },
            "ETH": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            },
            "BTC": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            },
            "USD": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            }
          }
        },
        "tradingFee": {
          "weightedAverageCost": "0.0",
          "breakdown": {
            "ETH": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            },
            "BTC": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            },
            "USDT": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            },
            "USD": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            }
          }
        },
        "spreadFee": {
          "weightedAverageCost": "0.0",
          "breakdown": {
            "ETH": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            },
            "BTC": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            },
            "USDT": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            },
            "USD": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            }
          }
        },
        "liquidationFee": {
          "weightedAverageCost": "0.0",
          "breakdown": {
            "ETH": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            },
            "BTC": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            },
            "USDT": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            },
            "USD": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            }
          }
        },
        "guaranteedStopLossFee": {
          "weightedAverageCost": "0.0",
          "breakdown": {
            "ETH": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            },
            "BTC": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            },
            "USDT": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            },
            "USD": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            }
          }
        }
      }
    },
    "costs": {
      "weightedAverageCost": "0.0",
      "details": {
        "technicalProviderFee": {
          "weightedAverageCost": "0.0",
          "breakdown": {
            "ETH": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            },
            "BTC": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            },
            "USDT": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            },
            "USD": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            }
          }
        },
        "marketDataProviderFee": {
          "weightedAverageCost": "0.0"
        },
        "newCoinListingCost": {
          "weightedAverageCost": "0.0"
        }
      }
    },
    "operatingExpenses": {
      "weightedAverageCost": "0.0",
      "details": {
        "salaries": "0.0",
        "rent": "0.0",
        "marketing": "0.0",
        "rebateExpenses": {
          "weightedAverageCost": "0.0",
          "breakdown": {
            "ETH": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            },
            "BTC": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            },
            "USDT": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            },
            "USD": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            }
          }
        }
      }
    },
    "financialCosts": {
      "weightedAverageCost": "0.0",
      "details": {
        "interestExpense": "0.0",
        "cryptocurrencyForexLosses": {
          "weightedAverageCost": "0.0",
          "breakdown": {
            "ETH": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            },
            "BTC": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            },
            "USDT": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            },
            "USD": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            }
          }
        },
        "fiatToCryptocurrencyConversionLosses": "0.0",
        "cryptocurrencyToFiatConversionLosses": "0.0",
        "fiatToFiatConversionLosses": "0.0"
      }
    },
    "otherGainLosses": {
      "weightedAverageCost": "0.0",
      "details": {
        "investmentGains": "0.0",
        "forexGains": "0.0",
        "cryptocurrencyGains": {
          "weightedAverageCost": "0.0",
          "breakdown": {
            "USDT": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            },
            "ETH": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            },
            "BTC": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            },
            "USD": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            }
          }
        }
      }
    }
  },
  "cashFlow": {
    "reportType": "cash flow sheet",
    "reportID": "1",
    "reportName": "first_report",
    "reportStartTime": 1498435200,
    "reportEndTime": 1498521599,
    "supplementalScheduleOfNonCashOperatingActivities": {
      "weightedAverageCost": "0.0",
      "details": {
        "cryptocurrenciesPaidToCustomersForPerpetualContractProfits": {
          "weightedAverageCost": "0.0"
        },
        "cryptocurrenciesDepositedByCustomers": {
          "weightedAverageCost": "0.0",
          "breakdown": {
            "USDT": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            },
            "ETH": {
              "amount": "0.12",
              "weightedAverageCost": "0.0"
            },
            "BTC": {
              "amount": "0.01",
              "weightedAverageCost": "0.0"
            }
          }
        },
        "cryptocurrenciesWithdrawnByCustomers": {
          "weightedAverageCost": "0.0",
          "breakdown": {
            "USDT": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            },
            "ETH": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            },
            "BTC": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            }
          }
        },
        "cryptocurrenciesPaidToSuppliersForExpenses": {
          "weightedAverageCost": "0.0",
          "breakdown": {
            "ETH": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            },
            "USDT": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            },
            "BTC": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            }
          }
        },
        "cryptocurrencyInflows": {
          "weightedAverageCost": "0.0",
          "breakdown": {
            "ETH": {
              "amount": "50249.999999999995805696",
              "weightedAverageCost": "0.0"
            },
            "BTC": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            },
            "USDT": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            }
          }
        },
        "cryptocurrencyOutflows": {
          "weightedAverageCost": "0.0",
          "breakdown": {
            "ETH": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            },
            "BTC": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            },
            "USDT": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            }
          }
        },
        "purchaseOfCryptocurrenciesWithNonCashConsideration": {
          "weightedAverageCost": "0.0",
          "breakdown": {
            "ETH": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            },
            "BTC": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            },
            "USDT": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            }
          }
        },
        "disposalOfCryptocurrenciesForNonCashConsideration": {
          "weightedAverageCost": "0.0",
          "breakdown": {
            "ETH": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            },
            "BTC": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            },
            "USDT": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            }
          }
        },
        "cryptocurrenciesReceivedFromCustomersAsTransactionFees": {
          "weightedAverageCost": "0.0",
          "breakdown": {
            "USDT": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            },
            "ETH": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            },
            "BTC": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            }
          }
        }
      }
    },
    "otherSupplementaryItems": {
      "details": {
        "relatedToNonCash": {
          "cryptocurrenciesEndOfPeriod": {
            "weightedAverageCost": "0.0"
          },
          "cryptocurrenciesBeginningOfPeriod": {
            "weightedAverageCost": "0.0"
          }
        },
        "relatedToCash": {
          "netIncreaseDecreaseInCashCashEquivalentsAndRestrictedCash": {
            "weightedAverageCost": "0.0"
          },
          "cryptocurrenciesBeginningOfPeriod": {
            "weightedAverageCost": "0.0"
          },
          "cryptocurrenciesEndOfPeriod": {
            "weightedAverageCost": "0.0"
          }
        }
      }
    },
    "operatingActivities": {
      "weightedAverageCost": "50249.999999999995805696",
      "details": {
        "cashDepositedByCustomers": {
          "weightedAverageCost": "50249.999999999995805696",
          "breakdown": {
            "USD": {
              "amount": "50249.999999999995805696",
              "weightedAverageCost": "50249.999999999995805696"
            }
          }
        },
        "cashWithdrawnByCustomers": {
          "weightedAverageCost": "0.0",
          "breakdown": {
            "USD": {
              "amount": "50249.999999999995805696",
              "weightedAverageCost": "50249.999999999995805696"
            }
          }
        },
        "purchaseOfCryptocurrencies": {
          "weightedAverageCost": "0.0"
        },
        "disposalOfCryptocurrencies": {
          "weightedAverageCost": "0.0"
        },
        "cashReceivedFromCustomersAsTransactionFee": {
          "weightedAverageCost": "0.0",
          "breakdown": {
            "USD": {
              "amount": "0.0",
              "weightedAverageCost": "50249.999999999995805696"
            }
          }
        },
        "cashPaidToSuppliersForExpenses": {
          "weightedAverageCost": "0.0",
          "breakdown": {
            "USD": {
              "amount": "0.0",
              "weightedAverageCost": "0.0"
            }
          }
        }
      }
    },
    "investingActivities": {
      "weightedAverageCost": "0.0"
    },
    "financingActivities": {
      "weightedAverageCost": "0.0",
      "details": {
        "proceedsFromIssuanceOfCommonStock": {
          "weightedAverageCost": "0.0"
        },
        "longTermDebt": {
          "weightedAverageCost": "0.0"
        },
        "shortTermBorrowings": {
          "weightedAverageCost": "0.0"
        },
        "paymentsOfDividends": {
          "weightedAverageCost": "0.0"
        },
        "treasuryStock": {
          "weightedAverageCost": "0.0"
        }
      }
    }
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8 enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant