定制 debyl/starknetphp 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

debyl/starknetphp

Composer 安装命令:

composer require debyl/starknetphp

包简介

PHP that allows you to interact with StarkNet L2 network

README 文档

README

starkwarephp allows you to interact with PHP application for StarkEx needs

starkware License

This project is a work-in-progress. Code and documentation are currently under development and are subject to change

Install

Requires PHP 8.0+

Install starkwarephp via the Composer package manager:

composer require debyl/starkwarephp

Usage

Test data from starkex-resources

The following code can be used with a public and private key to get signatures from Limit Order:

$party_a_order = [
    'vaultIdSell' => 21,
    'vaultIdBuy' => 27,
    'amountSell' => '2154686749748910716',
    'amountBuy' => '1470242115489520459',
    'tokenSell' => '0x5fa3383597691ea9d827a79e1a4f0f7989c35ced18ca9619de8ab97e661020',
    'tokenBuy' => '0x774961c824a3b0fb3d2965f01471c9c7734bf8dbde659e0c08dca2ef18d56a',
    'nonce' => 0,
    'expirationTimestamp' => 438953
];
$privateKey = '0x3c1e9550e66958296d11b60f8e8e7a7ad990d07fa65d5f7652c4a6c87d4e3cc'; // change with your private key
$publicKey  = '0x77a3b314db07c45076d11f62b6f9e748a39790441823307743cf00d6597ea43'; // change with your public key
$party_a = new Starknet($privateKey, $publicKey);
print_r($party_a->signLimitOrder( $party_a_order ));

The following code can be used with a public and private key to get message hash from Limit Order:

$party_a_order = [
    'vaultIdSell' => 21,
    'vaultIdBuy' => 27,
    'amountSell' => '2154686749748910716',
    'amountBuy' => '1470242115489520459',
    'tokenSell' => '0x5fa3383597691ea9d827a79e1a4f0f7989c35ced18ca9619de8ab97e661020',
    'tokenBuy' => '0x774961c824a3b0fb3d2965f01471c9c7734bf8dbde659e0c08dca2ef18d56a',
    'nonce' => 0,
    'expirationTimestamp' => 438953
];
$privateKey = '0x3c1e9550e66958296d11b60f8e8e7a7ad990d07fa65d5f7652c4a6c87d4e3cc'; // change with your private key
$publicKey  = '0x77a3b314db07c45076d11f62b6f9e748a39790441823307743cf00d6597ea43'; // change with your public key
$party_a = new Starknet($privateKey, $publicKey);
print $party_a->hashLimitOrder( $party_a_order );

Security

If you discover any security related issues, please email cryptodebyl@gmail.com instead of using the issue tracker.

Credits

  • [Crypto Debyl]

License

The MIT License (MIT). Please see License File for more information.

https://github.com/debyl

统计信息

  • 总下载量: 8
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-12-11