[PLAY STEEM x WepApp] Posting with Beneficiaries 성공

PLAY STEEM 개발자 이타인클럽입니다.
플러터로 웹앱을 만들고 있습니다.

그동안에는 주로 데이터를 가져오는 부분을 구현했고, 지난 번에 dsteem이라는 자바스크립트 client 라이브러리를 플러터에서 사용하여 포스팅도 성공했습니다.

그 때, beneficiary 지정하는 부분이 안됐었는데, 이제 성공했습니다.

image.png

베네피셔리 부분을 보면 다음과 같이 잘 설정되어 있습니다.

beneficiaries: Array(2)
0: {account: "etainclub", weight: 5000}
1: {account: "playsteemit", weight: 3000}
length: 2
__proto__: Array(0)

그리고 실제 SoHol이라는 앱을 통해서 포스팅 됐다는 내용도 함께 나타납니다.

json_metadata:
app: "SoHol/0.1.0"

방법

플러터에서 자바스크립트 라이브러리를 사용하는 것이 간단하지 않습니다. 특히 베네피셔리를 인자로 설정하는 부분이 처음 접하면 매우 헷갈립니다.

자바스크립트 라이브러리 함수에서 요구하는 부분을 클래스로 만들어줘야 합니다.
포스팅할 때 옵션으로 입력하는 자바스크립트 코드는 이렇게 생겼습니다.

extensions: [
  [
    0,
    {
         "beneficiaries": [
           {
             "account": 'etainclub',
             "weight": 5000,
           },
         ]
    },
  ]
],

저 extensions은 매우 복잡합니다.

플러터에서 포스팅 옵션인자를 위해 다음과 같은 클래스를 만듭니다.

@anonymous
@JS()
abstract class PostingOption {
  external String get author;
  external String get permlink;
  external String get max_accepted_payout;
  external int get percent_steem_dollars;
  external bool get allow_votes;
  external bool get allow_curation_rewards;
  external List<List<dynamic>> extensions;

  external factory PostingOption({
    String author,
    String permlink,
    String max_accepted_payout,
    int percent_steem_dollars,
    bool allow_votes,
    bool allow_curation_rewards,
    List<List<dynamic>> extensions,
  });
}

@anonymous
@JS()
abstract class ExtensionOption {
  external List<dynamic> beneficiaries;
  external factory ExtensionOption({
    List<dynamic> beneficiaries,
  });
}

@anonymous
@JS()
abstract class BeneficiaryOption {
  external String account;
  external int weight;
  external factory BeneficiaryOption({
    String account,
    int weight,
  });
}

위에서 만들어둔 클래스를 잘 사용하여 포스팅 옵션을 구성합니다.

  final _postingOption = PostingOption(
          author: options['author'],
          permlink: options['permlink'],
          max_accepted_payout: options['max_accepted_payout'],
          percent_steem_dollars: options['percent_steem_dollars'],
          allow_votes: options['allow_votes'],
          allow_curation_rewards: options['allow_curation_rewards'],
          extensions: [
            [
              0,
              ExtensionOption(
                beneficiaries: options['beneficiaries']
                    .map(
                      (item) => BeneficiaryOption(
                        account: item.account,
                        weight: item.weight,
                      ),
                    )
                    .toList(),
              ),
            ]
          ],

옵션을 잘 만들어 주고 다음과 같이 posting 함수를 호출합니다.

final result = await client.broadcast.sendOperations(opArray, privateKey);

베네셔리 설정하는 부분이 잘 되었기 때문에, 보팅이라던지 하는 부분도 빠르게 구현이 가능해졌습니다!

리스팀/팔로우/보팅/댓글/응원 부탁드립니다.

cc.
@steemcurator01



https://playsteem.app

Sort:  

hey @etainclub playsteem is cutting 5% of reward while giving 0.3 % what is thos behavior
Screenshot_20210619-054153.pngand see this one
Screenshot_20210619-060126.png post 0.03 unbelivable

Hi,
Basically, the beneficiary cut (currently 5%) is used to manage the app which has several paid service. Please consider this.

And the beneficiary cut is from author's reward.

image.png

In this case, your author's reward will be $0.25 (other $0.25 for curators). So the app takes $0.25 x 0.05 = $0.0125.

And I checked the app voted on this post, $0.05 (0.025 for the author, and 0.025 for the curator).

If you still think it is not reasonable, you don't have to use the app.

The voting will be automatic if you install the newer version of app.
https://playsteem.app
One vote per day.

sir we instal this app for support from your side but i see that @etainclub only give 0.03 reward means nothing and when little bit reward from curation team and cut off benificary cut then nothing to left we are new users we are still trying to gain power at that way how can we get power sorry to say its totaly injustice unwisely we wll uninstall this app

there was my mistake in voting manually. In your case, I thought you are not posting using the app. That's why the voting amount was small.
It will be around 10-15% of @etainclub's voting power.

And it is totally free to uninstall the app, whatever you want to do.

ok sir thanks for increase this manual it was hearted me more when i recived a very non reward from playsteem thanks once again sorry

ok sir thanks for increase this manual it was hearted me more when i recived a very non reward from playsteem thanks once again sorry

ok sir thanks for increase this manual it was hearted me more when i recived a very non reward from playsteem thanks once again sorry

Coin Marketplace

STEEM 0.30
TRX 0.12
JST 0.034
BTC 63960.62
ETH 3142.95
USDT 1.00
SBD 3.95