File tree Expand file tree Collapse file tree
packages/wasm-dpp/src/document/state_transition/batch_transition/token_transition Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ use dpp:: state_transition:: batch_transition:: token_burn_transition:: v0:: v0_methods:: TokenBurnTransitionV0Methods ;
12use dpp:: state_transition:: batch_transition:: TokenBurnTransition ;
23use wasm_bindgen:: prelude:: wasm_bindgen;
34
@@ -10,3 +11,16 @@ impl From<TokenBurnTransition> for TokenBurnTransitionWasm {
1011 Self ( value)
1112 }
1213}
14+
15+ #[ wasm_bindgen( js_class = TokenBurnTransition ) ]
16+ impl TokenBurnTransitionWasm {
17+ #[ wasm_bindgen( js_name=getPublicNote) ]
18+ pub fn public_note ( & self ) -> Option < String > {
19+ self . 0 . public_note ( ) . cloned ( )
20+ }
21+
22+ #[ wasm_bindgen( js_name=getBurnAmount) ]
23+ pub fn amount ( & self ) -> u64 {
24+ self . 0 . burn_amount ( )
25+ }
26+ }
Original file line number Diff line number Diff line change 1+ use dpp:: data_contract:: associated_token:: token_distribution_key:: TokenDistributionType ;
2+ use dpp:: state_transition:: batch_transition:: token_claim_transition:: v0:: v0_methods:: TokenClaimTransitionV0Methods ;
13use dpp:: state_transition:: batch_transition:: TokenClaimTransition ;
24use wasm_bindgen:: prelude:: wasm_bindgen;
35
@@ -10,3 +12,19 @@ impl From<TokenClaimTransition> for TokenClaimTransitionWasm {
1012 Self ( value)
1113 }
1214}
15+
16+ #[ wasm_bindgen( js_class = TokenClaimTransition ) ]
17+ impl TokenClaimTransitionWasm {
18+ #[ wasm_bindgen( js_name=getPublicNote) ]
19+ pub fn public_note ( & self ) -> Option < String > {
20+ self . 0 . public_note ( ) . cloned ( )
21+ }
22+
23+ #[ wasm_bindgen( js_name=getDistributionType) ]
24+ pub fn distribution_type ( & self ) -> u8 {
25+ match self . 0 . distribution_type ( ) {
26+ TokenDistributionType :: PreProgrammed => 0 ,
27+ TokenDistributionType :: Perpetual => 1 ,
28+ }
29+ }
30+ }
Original file line number Diff line number Diff line change 1+ use dpp:: state_transition:: batch_transition:: token_config_update_transition:: v0:: v0_methods:: TokenConfigUpdateTransitionV0Methods ;
12use dpp:: state_transition:: batch_transition:: TokenConfigUpdateTransition ;
23use wasm_bindgen:: prelude:: wasm_bindgen;
34
@@ -10,3 +11,11 @@ impl From<TokenConfigUpdateTransition> for TokenConfigUpdateTransitionWasm {
1011 Self ( value)
1112 }
1213}
14+
15+ #[ wasm_bindgen( js_class = TokenConfigUpdateTransition ) ]
16+ impl TokenConfigUpdateTransitionWasm {
17+ #[ wasm_bindgen( js_name=getPublicNote) ]
18+ pub fn public_note ( & self ) -> Option < String > {
19+ self . 0 . public_note ( ) . cloned ( )
20+ }
21+ }
Original file line number Diff line number Diff line change @@ -19,4 +19,9 @@ impl TokenDestroyFrozenFundsTransitionWasm {
1919 pub fn frozen_identity_id ( & self ) -> IdentifierWrapper {
2020 self . 0 . frozen_identity_id ( ) . into ( )
2121 }
22+
23+ #[ wasm_bindgen( js_name=getPublicNote) ]
24+ pub fn public_note ( & self ) -> Option < String > {
25+ self . 0 . public_note ( ) . cloned ( )
26+ }
2227}
Original file line number Diff line number Diff line change 1+ use dpp:: balances:: credits:: TokenAmount ;
2+ use dpp:: fee:: Credits ;
3+ use dpp:: state_transition:: batch_transition:: token_direct_purchase_transition:: v0:: v0_methods:: TokenDirectPurchaseTransitionV0Methods ;
14use dpp:: state_transition:: batch_transition:: TokenDirectPurchaseTransition ;
25use wasm_bindgen:: prelude:: wasm_bindgen;
36
@@ -10,3 +13,16 @@ impl From<TokenDirectPurchaseTransition> for TokenDirectPurchaseTransitionWasm {
1013 Self ( value)
1114 }
1215}
16+
17+ #[ wasm_bindgen( js_class = TokenDirectPurchaseTransition ) ]
18+ impl TokenDirectPurchaseTransitionWasm {
19+ #[ wasm_bindgen( js_name=getTokenCount) ]
20+ pub fn count ( & self ) -> TokenAmount {
21+ self . 0 . token_count ( )
22+ }
23+
24+ #[ wasm_bindgen( js_name=getTotalAgreedPrice) ]
25+ pub fn total_agreed_price ( & self ) -> Credits {
26+ self . 0 . total_agreed_price ( )
27+ }
28+ }
Original file line number Diff line number Diff line change 1+ use dpp:: state_transition:: batch_transition:: token_emergency_action_transition:: v0:: v0_methods:: TokenEmergencyActionTransitionV0Methods ;
12use dpp:: state_transition:: batch_transition:: TokenEmergencyActionTransition ;
3+ use dpp:: tokens:: emergency_action:: TokenEmergencyAction ;
24use wasm_bindgen:: prelude:: wasm_bindgen;
35
46#[ wasm_bindgen( js_name=TokenEmergencyActionTransition ) ]
@@ -10,3 +12,19 @@ impl From<TokenEmergencyActionTransition> for TokenEmergencyActionTransitionWasm
1012 Self ( value)
1113 }
1214}
15+
16+ #[ wasm_bindgen( js_class = TokenEmergencyActionTransition ) ]
17+ impl TokenEmergencyActionTransitionWasm {
18+ #[ wasm_bindgen( js_name=getPublicNote) ]
19+ pub fn public_note ( & self ) -> Option < String > {
20+ self . 0 . public_note ( ) . cloned ( )
21+ }
22+
23+ #[ wasm_bindgen( js_name=getEmergencyAction) ]
24+ pub fn emergency_action ( & self ) -> u8 {
25+ match self . 0 . emergency_action ( ) {
26+ TokenEmergencyAction :: Pause => 0 ,
27+ TokenEmergencyAction :: Resume => 1 ,
28+ }
29+ }
30+ }
Original file line number Diff line number Diff line change @@ -19,4 +19,9 @@ impl TokenFreezeTransitionWasm {
1919 pub fn frozen_identity_id ( & self ) -> IdentifierWrapper {
2020 self . 0 . frozen_identity_id ( ) . into ( )
2121 }
22+
23+ #[ wasm_bindgen( js_name=getPublicNote) ]
24+ pub fn public_note ( & self ) -> Option < String > {
25+ self . 0 . public_note ( ) . cloned ( )
26+ }
2227}
Original file line number Diff line number Diff line change @@ -28,4 +28,19 @@ impl TokenMintTransitionWasm {
2828 . with_js_error ( )
2929 . map ( Into :: into)
3030 }
31+
32+ #[ wasm_bindgen( js_name=getIssuedToIdentityId) ]
33+ pub fn issued_to_identity_id ( & self ) -> Option < IdentifierWrapper > {
34+ self . 0 . issued_to_identity_id ( ) . map ( |id| id. into ( ) )
35+ }
36+
37+ #[ wasm_bindgen( js_name=getPublicNote) ]
38+ pub fn public_note ( & self ) -> Option < String > {
39+ self . 0 . public_note ( ) . cloned ( )
40+ }
41+
42+ #[ wasm_bindgen( js_name=getAmount) ]
43+ pub fn amount ( & self ) -> u64 {
44+ self . 0 . amount ( )
45+ }
3146}
Original file line number Diff line number Diff line change 11use dpp:: state_transition:: batch_transition:: TokenSetPriceForDirectPurchaseTransition ;
22use wasm_bindgen:: prelude:: wasm_bindgen;
3+ use dpp:: fee:: Credits ;
4+ use dpp:: state_transition:: batch_transition:: token_set_price_for_direct_purchase_transition:: v0:: v0_methods:: TokenSetPriceForDirectPurchaseTransitionV0Methods ;
5+ use dpp:: tokens:: token_pricing_schedule:: TokenPricingSchedule ;
36
47#[ wasm_bindgen( js_name=TokenSetPriceForDirectPurchaseTransition ) ]
58#[ derive( Debug , Clone ) ]
@@ -12,3 +15,22 @@ impl From<TokenSetPriceForDirectPurchaseTransition>
1215 Self ( value)
1316 }
1417}
18+
19+ #[ wasm_bindgen( js_class=TokenSetPriceForDirectPurchaseTransition ) ]
20+ impl TokenSetPriceForDirectPurchaseTransitionWasm {
21+ #[ wasm_bindgen( js_name=getPublicNote) ]
22+ pub fn public_note ( & self ) -> Option < String > {
23+ self . 0 . public_note ( ) . cloned ( )
24+ }
25+
26+ #[ wasm_bindgen( js_name=getPrice) ]
27+ pub fn price ( & self ) -> Option < Credits > {
28+ match self . 0 . price ( ) {
29+ Some ( token_pricing_schedule) => match token_pricing_schedule {
30+ TokenPricingSchedule :: SinglePrice ( credits) => Some ( * credits) ,
31+ TokenPricingSchedule :: SetPrices ( _) => None ,
32+ } ,
33+ None => None ,
34+ }
35+ }
36+ }
Original file line number Diff line number Diff line change @@ -19,4 +19,14 @@ impl TokenTransferTransitionWasm {
1919 pub fn recipient_id ( & self ) -> IdentifierWrapper {
2020 self . 0 . recipient_id ( ) . into ( )
2121 }
22+
23+ #[ wasm_bindgen( js_name=getPublicNote) ]
24+ pub fn public_note ( & self ) -> Option < String > {
25+ self . 0 . public_note ( ) . cloned ( )
26+ }
27+
28+ #[ wasm_bindgen( js_name=getAmount) ]
29+ pub fn amount ( & self ) -> u64 {
30+ self . 0 . amount ( )
31+ }
2232}
You can’t perform that action at this time.
0 commit comments