Gnosis-Safe
gnosis safe-core-sdk 服務能否與 safe-react-gateway-sdk 完全脫離鏈?
SafeSdk 和網關 API 很棒,但它能支持完整的鏈下簽名嗎?
從文件:
User1 signs: safeSdk.signTransaction() is offchain, User2 signs with: safeSdk.approveTransactionHash() <-- but this is an onchain call and requires gas.
也可以
user2~n
呼叫safeSdk.signTransaction()
並將其記錄在安全網關上,以便它在隊列中可用(來自 getTransactionQueue)?謝謝
是的,所有簽名者都可以在鏈下簽署交易並將簽名發送到安全交易服務,因此它會出現在 Web UI 的隊列中。
該
@gnosis.pm/safe-core-sdk
軟體包允許像這樣在鏈下簽署交易:... const safeTxHash = await safeCoreSdk.getTransactionHash(safeTransaction) const signature = await safeCoreSdk.signTransactionHash(safeTxHash)
該
@gnosis.pm/safe-service-client
包允許將該簽名發送到交易服務:import SafeServiceClient from '@gnosis.pm/safe-service-client' ... const safeService = new SafeServiceClient({ txServiceUrl, ethAdapter }) await safeService.confirmTransaction(safeTxHash, signature.data)
您將按照本指南找到更完整的答案:https ://github.com/safe-global/safe-core-sdk/blob/main/guides/integrating-the-safe-core-sdk.md#confirm-transaction