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

[ANCHOR-809][SEP-6] Add funding_method to SEP-6 #1582

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

JiahuiWho
Copy link
Contributor

Description

  • In /info response, replace fields(in deposit) and types(in withdraw) with funding_methods
  • In all 4 transaction creation request, replace type with funding_method, and this param will be mandatory

Context

SEP-31 changes scoped in stellar/stellar-protocol#1567

Testing

  • ./gradlew test

"optional": false
}
}
"funding_methods": ["SEPA", "SWIFT"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense to support the type request parameter when the /info response returns funding_methods?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The plan is to support funding_method while deprecating type. Same as discussion #1581 (comment)

requestValidator.validateTypes(
request.getType(), sellAsset.getCode(), sellAsset.getSep6().getWithdraw().getMethods());
fundingMethod, sellAsset.getCode(), sellAsset.getSep6().getWithdraw().getMethods());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we not need to persist this field in the database?

Copy link
Contributor Author

@JiahuiWho JiahuiWho Nov 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In db it's stilled saved as type. I'm not gonna make the change for now (at least in this pr) as type is a preserved word, and it's causing a lot of issue when I was trying to either drop or rename it.

@@ -90,7 +92,8 @@ public StartDepositResponse depositExchange(
@RequestParam(value = "account") String account,
@RequestParam(value = "memo_type", required = false) String memoType,
@RequestParam(value = "memo", required = false) String memo,
@RequestParam(value = "type") String type,
@RequestParam(value = "funding_method", required = false) String fundingMethod,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this PR's description and the protocol, funding_method is a required parameter. Is it supposed to be required?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It 's not marked as required because we need to support both type and funding_method and they are referencing the same thing

/**
* The fields required to initiate a deposit.
*
* <p>The only field supported by the platform is <code>type</code>. Additional fields required
* for KYC are supplied asynchronously through SEP-12 requests.
*/
Map<String, AssetInfo.Field> fields;
@Deprecated Map<String, AssetInfo.Field> fields;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add comments to the SEP version that deprecates the field.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you point me to where it's missing ? I believe I have marked it as deprecated

/**
* The types of withdrawal methods supported and their fields.
*
* <p>The platform does not allow fields to be configured for withdrawal methods. Financial
* account and KYC information is supplied asynchronously through PATCH requests and SEP-12
* requests respectively.
*/
Map<String, WithdrawType> types;
@Deprecated Map<String, WithdrawType> types;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add comments to the SEP version that deprecates the field.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you point me to where it's missing ? I believe I have marked it as deprecated

String fundingMethod;

/** Type of deposit. Deprecated in favor of funding_method */
@Deprecated String type;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you point me to where it's missing ? I believe I have marked it as deprecated

String fundingMethod;

/** Type of deposit. Deprecated in favor of funding_method */
@Deprecated String type;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

String fundingMethod;

/** The type of withdrawal to make. Deprecated in favor of funding_method */
@Deprecated String type;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you point me to where it's missing ? I believe I have marked it as deprecated

String fundingMethod;

/** Type of withdrawal. Deprecated in favor of funding_method */
@Deprecated String type;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you point me to where it's missing ? I believe I have marked it as deprecated

@JiahuiWho JiahuiWho marked this pull request as ready for review November 26, 2024 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants