Token XRPL listing - listings

I am trying to list a token of XRPL, set truct and receive the following
"error_message" => "Field 'tx_json.LimitAmount' has invalid data."
"request" => array:5 [▼
"command" => "submit"
"fee_mult_max" => 1000
"offline" => false
"secret" => "<masked>"
"tx_json" => array:6 [▼
"Account" => "rX49UBNi94tCCt2jb7tHVjdYSVwHNhQK2"
"DestinationTag" => 1
"Fee" => "15000"
"Flags" => 262144
"LimitAmount" => array:3 [▼
"currency" => "Xoge"
"issuer" => "rJMtvf5B3GbuFMrqybh5wYVXEH4QE8VyU1"
"value" => "1000000000000000"
]
"TransactionType" => "TrustSet"
]
]
"status" => "error"
using this document: https://xrpl.org/trustset.html

XRP Ledger supports either a three-letter ISO 4217 Currency Code or a 160-bit(40-character) hexadecimal string as value for "currency" field.
In your case(above code), you are using "Xoge" as value for the field "currency" inside "LimitAmount" object. "Xoge" has more than 3 letters, so it's throwing error. You can either switch to a 3 letter currency code or convert "Xoge" into 160-bit(40-character) hexadecimal string.
LimitAmount: {
currency: '586F676500000000000000000000000000000000',
issuer: 'rJMtvf5B3GbuFMrqybh5wYVXEH4QE8VyU1',
value: '1000000000000000'
},
Here 586F676500000000000000000000000000000000 represents Xoge in 160-bit hex.
Couple of more things I noticed from your code:
Fee is represented in drops. So you can lower your fee a bit, and it'll still work.
You are setting flag 262144 which enables rippling. Usually TrustLine is setup by regular users with the issuer, so it's always recommended to have flag 131072, which blocks rippling from the user end of the TrustLine.

Related

iOS VoIP push notifications and Firebase

I'm trying to send VoIP push notifications through the Firebase. I uploaded a *.p8 file to my project in the Firebase Console and now have an APNs Auth Key displayed there.
My alarm push notifications are delivered without any problems:
'apns' => [
'headers' => [
'apns-push-type' => ‘alarm',
],
...
But when I try to change the type to voip I get an error:
'apns' => [
'headers' => [
'apns-push-type' => 'voip',
'apns-topic' => ‘com.mycompany.myapp.voip'
],
...
Firebase response:
#errors: array:1 [
"error" => array:4 [
"code" => 400
"message" => "Request contains an invalid argument."
"status" => "INVALID_ARGUMENT"
"details" => array:2 [
0 => array:2 [
"#type" => "type.googleapis.com/google.firebase.fcm.v1.FcmError"
"errorCode" => "INVALID_ARGUMENT"
]
1 => array:2 [
"#type" => "type.googleapis.com/google.rpc.BadRequest"
"fieldViolations" => array:1 [
0 => array:2 [
"field" => "message.token"
"description" => "Invalid registration token"
]
]
]
]
]
]
Any ideas? Am I missing something important?
The situation at the date (16/03/2020): No, Firebase Cloud Messaging doesn't support APNS VoIP push notifications, but it's planned.
The official Firebase support answer:
Currently, VoIP push is not supported by FCM. However, we're aware that a lot of developers like you want this, so there's already a feature request filed for this. As of now, we are yet to find out any details or timelines as to when it will be implemented. You can check our release notes from time to time for any updates about Firebase features and its services.

How to solve Symfony 4 Password null error?

I have a form which has a Repeat password. On blank submission, I get the following error.
Expected argument of type "string", "NULL" given at property path "password".
UserType:
$builder
->add('email',TextType::class)
->add('password',RepeatedType::class,
[
'type'=>PasswordType::class,
'required'=> false,
'invalid_message' => 'The password fields must match.',
'empty_data'=> ''
])
->add('firstname',TextType::class)
->add('lastname',TextType::class)
->add('submit', SubmitType::class)
;
When I insert the value in either password field I get the validation message, but if I keep both blanks I get the above-written error.

DynamoDB UpdateItem with ReturnValues parameter returns nothing on failed ConditionExpression

Using aws/aws-sdk-php 3.21.6. I must be misunderstanding how ReturnValues works when a ConditionExpression meets the ConditionalCheckFailedException error.
What I'm hoping is that if the ConditionExpression fails, which in turn triggers the ConditionalCheckFailedException, that I can catch this exception and then get access via ReturnValues to the new Attributes from DD.
The docs Attributes I'm expecting from ReturnValues seem to imply this.
From testing, however, ReturnValues only returns Attributes if the ConditionExpression is true, not when it fails.
$response = $client->updateItem([
'TableName' => 'MyTable',
'Key' => [
'customer_url' => [
'S' => 'someurl.com'
],
'customer_platform' => [
'S' => 'some_platform'
]
],
'ExpressionAttributeNames' => [
'#C' => 'createdAt'
],
'ExpressionAttributeValues' => [
':val1' => [
'S' => '2017-01-24T14:15:32'
],
':val2' => [
'S' => '2017-01-24T14:15:30'
]
],
'UpdateExpression' => 'set #C = :val1',
'ConditionExpression' => '#C = :val2', // :val2 originally was 2017-01-24T14:15:30, before attempting to update to 2017-01-24T14:15:32. If I change the field to 2017-01-24T14:15:31, before running this update it will throw the ConditionalCheckFailedException
'ReturnValues' => 'ALL_NEW'
]);
Yes, ReturnValues is populated only if an updateItem succeeds. If it fails, because of ConditionalCheckFailedException or any other reason, ReturnValues will be null.
Supporting documentation from here, with emphasis mine:
Use ReturnValues if you want to get the item attributes as they appeared either before or after they were updated.

AclVoter denies access to 'LIST'

As soon as I set sonata_admin.security.handler to sonata.admin.security.handler.acl the only user who has access is the one with ROLE_SUPER_ADMIN.
I think I configured everything right, obviously not.
I tried:
to give the user the real role ROLE_VIP_CONTACT_ADMIN instead of assigning by a fos_group, no success.
all options forsecurity.access_decision_manager.strategy: affirmative, consensus and unanimous
to delete all acl tables, acl:init, sonata:admin:setup-acl, with and without sonata:admin:generate-object-acl and cleared the cache every time.
With no success.
# Acme\MyBundle\Controller\CRUDController.php
$securityContext->getAdminPermissions();
# -> ["CREATE", "LIST", "DELETE", "UNDELETE", "EXPORT", "OPERATOR", "MASTER"]
dump($this->admin->getSecurityInformation());
/* -> array:3 [▼
"GUEST" => array:2 [▼
0 => "VIEW"
1 => "LIST"
]
"STAFF" => array:3 [▼
0 => "EDIT"
1 => "LIST"
2 => "CREATE"
]
"ADMIN" => array:3 [▼
0 => "MASTER"
1 => "OPERATOR"
2 => "EXPORT"
]
] */
dump($this->getUser()->getRoles());
/* -> array:15 [▼
0 => "ROLE_ADMIN"
1 => "ROLE_VIP_CONTACT_GUEST"
2 => "ROLE_VIP_CONTACT_STAFF"
3 => "ROLE_VIP_CONTACT_ADMIN" # <--- I gave him everything!
[...]
9 => "ROLE_ALLOWED_TO_SWITCH"
[...]
16 => "ROLE_USER"
] */
Now I open my browser and go to app_dev.php/my-path-to/vip/contact/list, resulting in an AccessDeniedException.
/edit: It's the same problem as here ACL + SonataAdminBundle + SonataUserBundle.
On Symphony >3.1 you should use this:
services:
security.acl.permission.map:
class: Sonata\AdminBundle\Security\Acl\Permission\AdminPermissionMap
instead
parameters:
security.acl.permission.map.class: Sonata\AdminBundle\Security\Acl\Permission\AdminPermissionMap
After hours of debugging, the result is to let ACL know about the LIST permission by using Sonata's AdminPermissionMap.
See SonataAdminBundle 5. Security and Documentation » Admin (Ctrl+F: security.acl.permission.map.class)
parameters:
security.acl.permission.map.class: Sonata\AdminBundle\Security\Acl\Permission\AdminPermissionMap
You might already know this.
To make a long story short: Configuration is not only done by writing some config files, but also to import the right ones.

Accessing nested parameters in Symfony ParameterBag

Have a request that looks like this
ParameterBag {#362 ▼
#parameters: array:1 [▼
"form" => array:5 [▼
"titre" => "new b"
"prix" => "4444"
"slug" => "with-different-slug"
"publier" => "unpub"
"Modifier" => ""
]
]
}
How can I use the
$post = Request::createFromGlobals();
$post->request->has() on those nested properties?
ParameterBag's has function does not support deep check. It is just an array_key_exists call.
You could use get with $deep parameter set to true.
E.g.:
$post = Request::createFromGlobals();
$post->request->get('form[titre]', null, true);
It will return null (the second parameter), if the value does not exist.
EDIT:
This function however deprecated in 2.8.
Using paths to find deeper items in get is deprecated since version 2.8 and will be removed in 3.0. Filter the returned value in your own code instead.

Resources