Я собрал схему но она не заработала, выдаёт ошибку. Сам справиться не смог.
Как я предполагаю "Signature not valid: Invalid submission time or incorrect time format"
смысл написанного в описании ошибки - не правда и проблема не во времени, а причина в чём то другом.
Описание API
https://huobiapi.github.io/docs/spot/v1/en/#authentication
Еще описание API
https://github.com/huobiapi/API_Docs_en/wiki/Signing_API_Requests
Схема HiASM
Add(MainForm,2953706,21,105)
{
Width=1674
Height=776
Position=1
}
Add(Timer,1678013,28,196)
{
Interval=250
AutoStop=1
link(onTimer,14388011:doFileExists,[])
}
Add(MultiElementEx,14388011,91,196)
{
@Hint=#13:Api Keys Load|
AddHint(46,-27,83,13,@Hint)
}
BEGIN_SDK
Add(EditMultiEx,13315523,21,21)
{
WorkCount=#12:doFileExists|
EventCount=#11:onEventData|
Width=1021
Height=606
link(doFileExists,7969757:doEvent1,[(221,27)(221,293)])
}
Add(GlobalVar,6549160,546,245)
{
Name="Key"
}
Add(GlobalVar,1096561,553,287)
{
Name="Secret Key"
}
Add(GlobalVar,1241793,546,399)
{
Name="CustomerID"
}
Add(DoData,6774689,483,287)
{
Data=String(b86edebd-003ffa1d-e17aebd6-9668e)
link(onEventData,1096561:doValue,[])
}
Add(DoData,2983376,483,245)
{
Data=String(ghxertfvbf-ae071afe-585ebe3a-bcd73)
link(onEventData,6549160:doValue,[])
}
Add(Hub,7969757,420,287)
{
link(onEvent1,6774689:doData,[])
link(onEvent2,2983376:doData,[(458,300)(458,251)])
}
END_SDK
Add(Button,3906501,210,420)
{
Left=65
Top=40
Width=80
Height=25
link(onClick,5981281:doData,[])
}
Add(Memo,1227602,812,448)
{
Left=85
Top=225
Width=1530
Height=455
ScrollBars=2
}
Add(Hub,2461062,420,420)
{
OutCount=4
link(onEvent1,6727377:doConvert,[(455,426)(455,321)])
link(onEvent2,2028001:doEvent1,[(498,433)(498,398)])
link(onEvent3,14916914:doDownload,[(539,440)(539,468)])
}
Add(MultiElementEx,2028001,644,392)
{
@Hint=#6:apiign|
link(onFString,2470777:doWork1,[(767,398)])
link(Str1,7514225:Var,[])
AddHint(41,7,43,13,@Hint)
}
BEGIN_SDK
Add(EditMultiEx,7989993,21,21)
{
WorkCount=#8:doEvent1|
EventCount=#9:onFString|
VarCount=#7:FString|
DataCount=#4:Str1|0:|
Width=1441
Height=1250
link(doEvent1,14146548:doData,[(84,27)(84,223)])
link(FString,7559000:Result,[(27,977)(1021,977)])
}
Add(FormatStr,116698,273,322)
{
@Hint=#12:AccessKeyId=|
DataCount=1
Mask="AccessKeyId=%1"
Point(FString)
link(onFString,4199974:doWork2,[])
link(Str1,6654474:Var,[])
AddHint(45,10,83,13,@Hint)
}
Add(FormatStr,10023390,273,371)
{
@Hint=#16:SignatureMethod=|
DataCount=1
Mask="SignatureMethod=HmacSHA256"
Point(FString)
link(onFString,10715364:doWork2,[])
AddHint(45,17,102,13,@Hint)
}
Add(FormatStr,1795796,273,420)
{
@Hint=#17:SignatureVersion=|
DataCount=1
Mask="SignatureVersion=2"
Point(FString)
link(onFString,11765676:doWork2,[])
AddHint(45,12,101,13,@Hint)
}
Add(FormatStr,9334294,273,490)
{
@Hint=#10:Timestamp=|
DataCount=1
Mask="Timestamp=%1"
Point(FString)
link(onFString,11765676:doWork3,[(459,496)])
link(Str1,8331751:Var,[])
AddHint(48,15,72,13,@Hint)
}
Add(FormatStr,1651388,686,1582)
{
}
Add(FormatStr,5166760,294,147)
{
@Hint=#31:GET\napi.huobi.pro\n/v1/ПУТЬ\n?|
DataCount=1
Mask="GET\r\napi.huobi.pro\r\n/v1/%1\r\n"
Point(FString)
link(onFString,303221:doEvent1,[])
link(Str1,488125:Var3,[(300,131)])
AddHint(38,-29,189,13,@Hint)
}
Add(FormatStr,12776623,273,224)
{
@Hint=#31:https://api.huobi.pro/v1/ПУТЬ/?|
DataCount=1
Mask="https://api.huobi.pro/v1/%1?"
Point(FString)
link(Str1,488125:Var2,[])
AddHint(45,6,175,13,@Hint)
}
Add(Memory,14827750,273,84)
{
@Hint=#4:Путь|
Default=String(account/accounts)
AddHint(-8,-30,39,13,@Hint)
}
Add(Hub,1347685,196,217)
{
OutCount=7
PColor(onEvent7,0)
link(onEvent1,5166760:doString,[(256,223)(256,153)])
link(onEvent2,12776623:doString,[])
link(onEvent3,116698:doString,[(252,237)(252,328)])
link(onEvent4,10023390:doString,[(252,244)(252,377)])
link(onEvent5,1795796:doString,[(252,251)(252,426)])
link(onEvent6,9334294:doString,[(252,258)(252,496)])
link(onEvent7,13697505:doEvent1,[(229,265)(229,585)(481,585)(481,370)])
}
Add(GetDataEx,488125,273,126)
{
link(Data,14827750:Value,[])
}
Add(GlobalVar,6654474,273,294)
{
Name="Key"
}
Add(GlobalVar,8331751,273,462)
{
Name="Timestamp"
}
Add(StrList,3076424,602,322)
{
Strings=#11:AccessKeyId|15:SignatureMethod|16:SignatureVersion|9:Timestamp|10:Signature=|
Point(doSort)
}
Add(ArrayEnum,536979,616,441)
{
link(onItem,9219833:doString,[])
link(onEndEnum,9824417:doData,[(657,454)(657,503)])
link(Array,6308017:ArraySort,[])
}
Add(Hub,13697505,525,364)
{
OutCount=5
link(onEvent1,3076424:doSort,[])
link(onEvent2,6308017:doSort,[(588,377)(588,398)])
link(onEvent3,536979:doEnum,[(579,384)(579,447)])
link(onEvent4,7304488:doCalcHMAC,[(569,391)(569,559)])
link(onEvent5,2300580:doString,[(557,398)(557,657)])
}
Add(ArraySort,6308017,616,392)
{
CaseSensitive=0
link(Array,3076424:Array,[])
}
Add(LineBreak,1375659,560,336)
{
Caption="cl"
link(Out,3076424:doClear,[(596,342)(596,335)])
Primary=[13159837,-189,-189]
}
Add(HubEx,4199974,455,322)
{
link(onEvent,3076424:doAdd,[])
}
Add(HubEx,10715364,455,371)
{
Angle=3
link(onEvent,4199974:doWork3,[])
}
Add(HubEx,11765676,455,420)
{
Angle=3
link(onEvent,10715364:doWork3,[])
}
Add(FormatStr,9219833,665,441)
{
DataCount=1
Mask="%1&"
link(onFString,6233710:doStrCat,[])
}
Add(StrCat,6233710,763,441)
{
Point(doClear)
link(Str1,1697834:Var3,[(769,426)(804,426)(804,481)])
}
Add(DoData,9824417,763,497)
{
link(onEventData,169938:doDelete,[])
link(Data,1697834:Var2,[])
}
Add(Hub,303221,343,147)
{
OutCount=5
link(onEvent1,13159837:In,[])
link(onEvent2,16635212:In,[])
link(onEvent3,16223361:In,[])
link(onEvent4,8891139:In,[])
link(onEvent5,9382332:In,[])
}
Add(LineBreak,2246243,714,462)
{
Caption="cl"
link(Out,6233710:doClear,[(754,468)(754,454)])
Primary=[16635212,-343,-308]
}
Add(GetDataEx,1697834,763,476)
{
link(Data,6233710:Result,[])
}
Add(Delete,169938,812,497)
{
Count=1
Direction=1
link(onDelete,6066075:doEvent1,[])
}
Add(MultiElementEx,7304488,1022,553)
{
@Hint=#26:Вычисляет Signature строки|
link(Data,8571522:Text,[(1028,540)(1126,540)])
AddHint(48,3,156,13,@Hint)
}
BEGIN_SDK
Add(EditMultiEx,3473821,392,70)
{
WorkCount=#10:doCalcHMAC|
VarCount=#3:Var|
DataCount=#4:Data|
Width=510
Height=284
link(doCalcHMAC,1896755:doCalcHMAC,[(466,76)(466,195)])
link(Var,519791:Var,[(398,278)(790,278)])
}
Add(GlobalVar,4475531,553,161)
{
Name="Secret Key"
}
Add(HMAC,1896755,539,189)
{
Algorithm=2
Point(doAlgorithm)
link(onResult,769276:doConvert,[])
link(Data,3473821:Data,[(545,129)(398,129)])
link(Key,4475531:Var,[(552,182)(559,182)])
}
Add(Charset,5987243,637,189)
{
Type=5
link(onCharset,7320174:doCharset,[])
}
Add(StrCase,10669880,679,238)
{
}
Add(StreamConvertor,769276,588,189)
{
Mode=3
link(onResult,5987243:doCharset,[])
}
Add(GlobalVar,519791,784,189)
{
Name="Signature"
}
Add(Charset,7320174,693,189)
{
Type=12
link(onCharset,519791:doValue,[])
}
END_SDK
Add(LineBreak,5034944,1015,448)
{
Caption="cl"
link(Out,8571522:doClear,[(1083,454)(1083,475)])
Primary=[16223361,-644,-287]
}
Add(FormatStr,9859844,973,504)
{
Mask="%1%2"
link(onFString,8571522:doText,[(1063,510)(1063,489)])
link(Str1,13005706:Var,[])
}
Add(LineBreak,14477977,294,189)
{
Type=1
link(Data,5166760:FString,[])
Primary=[13005706,679,287]
}
Add(LineBreak,259257,273,273)
{
Type=1
link(Data,12776623:FString,[])
Primary=[5625049,693,336]
}
Add(Memory,128660,896,448)
{
Default=String()
}
Add(LineBreak,15314638,840,455)
{
Caption="cl"
link(Out,128660:doClear,[])
Primary=[8891139,-469,-287]
}
Add(FormatStr,2300580,966,651)
{
@Hint=#20:Добавляет Signature=|
DataCount=3
Mask="%1%2&Signature=%3"
Point(FString)
link(onFString,7559000:doStrCat,[])
link(Str1,5625049:Var,[])
link(Str2,14087859:Var2,[(979,541)(902,541)])
AddHint(-151,15,125,13,@Hint)
}
Add(DoData,14146548,147,217)
{
Data=String()
link(onEventData,1347685:doEvent1,[])
}
Add(StrCat,7559000,1015,651)
{
Point(doClear)
link(Str2,7304488:Var,[])
}
Add(LineBreak,9094780,966,721)
{
Caption="cl"
link(Out,7559000:doClear,[(1006,727)(1006,664)])
Primary=[9382332,-595,-546]
}
Add(StrList,8571522,1120,462)
{
}
Add(Hub,6066075,861,497)
{
link(onEvent1,128660:doValue,[(885,503)(885,454)])
link(onEvent2,9975099:doData,[])
}
Add(DoData,9975099,917,504)
{
link(onEventData,9859844:doString,[])
link(Data,14087859:Var3,[(923,488)])
}
Add(GetDataEx,14087859,896,483)
{
link(Data,128660:Value,[])
}
END_SDK
Add(StreamConvertor,16441410,700,469)
{
Mode=4
link(onResult,2470777:doWork2,[])
}
Add(HTTP_Get,14916914,644,462)
{
Wait=0
UserAgent="Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36"
Point(PostData)
link(onDownload,16441410:doConvert,[])
link(URL,2028001:FString,[])
}
Add(DoData,5981281,266,420)
{
Data=String()
link(onEventData,2461062:doEvent1,[])
}
Add(DateConvertor,6727377,504,315)
{
Mode=9
Format="yyyy-MM-ddTHH:mm:ss"
Point(Data)
link(onResult,12686715:doCharset,[])
link(Data,2658085:DateTime,[])
}
Add(Time,2658085,497,273)
{
Point(DateTime)
}
Add(Charset,12686715,553,315)
{
Type=12
link(onCharset,7514225:doValue,[])
}
Add(GlobalVar,7514225,644,315)
{
Name="Timestamp"
}
Add(HubEx,2470777,763,469)
{
link(onEvent,1227602:doText,[])
}
Редактировалось 2 раз(а), последний 2019-11-13 06:56:18