@dfinity/sns 3.0.6 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/candid/sns_governance.did +1 -1
- package/dist/candid/sns_governance_test.did +1 -1
- package/dist/candid/sns_root.did +1 -1
- package/dist/candid/sns_swap.certified.idl.js +0 -5
- package/dist/candid/sns_swap.d.ts +0 -1
- package/dist/candid/sns_swap.did +1 -2
- package/dist/candid/sns_swap.idl.js +0 -5
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/index.cjs.js.map +2 -2
- package/dist/esm/chunk-34CD4QJG.js +2 -0
- package/dist/esm/chunk-34CD4QJG.js.map +7 -0
- package/dist/esm/{chunk-VWOOXKKM.js → chunk-R7I3KJ5Z.js} +2 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/sns.js +1 -1
- package/dist/esm/swap.canister.js +1 -1
- package/package.json +6 -6
- package/dist/esm/chunk-EPQ5JVPZ.js +0 -2
- package/dist/esm/chunk-EPQ5JVPZ.js.map +0 -7
- /package/dist/esm/{chunk-VWOOXKKM.js.map → chunk-R7I3KJ5Z.js.map} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Canister as Ct,createServices as Bt,fromDefinedNullable as x,fromNullable as f}from"@dfinity/utils";var ht=({IDL:t})=>{let i=t.Record({dissolve_delay_interval_seconds:t.Nat64,count:t.Nat64}),e=t.Record({slope_numerator:t.Opt(t.Nat64),intercept_icp_e8s:t.Opt(t.Nat64),from_direct_participation_icp_e8s:t.Opt(t.Nat64),slope_denominator:t.Opt(t.Nat64),to_direct_participation_icp_e8s:t.Opt(t.Nat64)}),n=t.Record({serialized_representation:t.Opt(t.Text)}),s=t.Record({coefficient_intervals:t.Vec(e),max_neurons_fund_participation_icp_e8s:t.Opt(t.Nat64),min_direct_participation_threshold_icp_e8s:t.Opt(t.Nat64),ideal_matched_participation_function:t.Opt(n)}),r=t.Record({has_created_neuron_recipes:t.Opt(t.Bool),nns_neuron_id:t.Nat64,amount_icp_e8s:t.Nat64}),a=t.Record({hotkey_principal:t.Text,cf_neurons:t.Vec(r)}),l=t.Record({cf_participants:t.Vec(a)}),S=t.Record({iso_codes:t.Vec(t.Text)}),O=t.Record({nns_proposal_id:t.Opt(t.Nat64),sns_root_canister_id:t.Text,neurons_fund_participation:t.Opt(t.Bool),min_participant_icp_e8s:t.Opt(t.Nat64),neuron_basket_construction_parameters:t.Opt(i),fallback_controller_principal_ids:t.Vec(t.Text),max_icp_e8s:t.Opt(t.Nat64),neuron_minimum_stake_e8s:t.Opt(t.Nat64),confirmation_text:t.Opt(t.Text),swap_start_timestamp_seconds:t.Opt(t.Nat64),swap_due_timestamp_seconds:t.Opt(t.Nat64),min_participants:t.Opt(t.Nat32),sns_token_e8s:t.Opt(t.Nat64),nns_governance_canister_id:t.Text,transaction_fee_e8s:t.Opt(t.Nat64),icp_ledger_canister_id:t.Text,sns_ledger_canister_id:t.Text,neurons_fund_participation_constraints:t.Opt(s),neurons_fund_participants:t.Opt(l),should_auto_finalize:t.Opt(t.Bool),max_participant_icp_e8s:t.Opt(t.Nat64),sns_governance_canister_id:t.Text,min_direct_participation_icp_e8s:t.Opt(t.Nat64),restricted_countries:t.Opt(S),min_icp_e8s:t.Opt(t.Nat64),max_direct_participation_icp_e8s:t.Opt(t.Nat64)}),g=t.Record({source_principal_id:t.Opt(t.Principal)}),w=t.Record({block_height:t.Opt(t.Nat64)}),h=t.Record({description:t.Opt(t.Text),error_type:t.Opt(t.Int32)}),P=t.Variant({Ok:w,Err:h}),b=t.Record({result:t.Opt(P)}),o=t.Record({code:t.Opt(t.Int32),description:t.Text}),F=t.Record({err:t.Opt(o),dapp_canister_id:t.Opt(t.Principal)}),v=t.Record({failed_updates:t.Vec(F)}),V=t.Variant({Ok:v,Err:o}),C=t.Record({possibility:t.Opt(V)}),c=t.Record({failure:t.Nat32,skipped:t.Nat32,invalid:t.Nat32,success:t.Nat32,global_failures:t.Nat32}),B=t.Record({error_message:t.Text,error_type:t.Int32}),z=t.Record({governance_error:t.Opt(B)}),E=t.Variant({Ok:z,Err:o}),q=t.Record({possibility:t.Opt(E)}),G=t.Record({neurons_fund_participation_icp_e8s:t.Opt(t.Nat64),neurons_fund_neurons_count:t.Opt(t.Nat64)}),A=t.Record({message:t.Opt(t.Text)}),U=t.Variant({Ok:G,Err:A}),M=t.Record({possibility:t.Opt(U)}),Q=t.Variant({Ok:t.Record({}),Err:o}),j=t.Record({possibility:t.Opt(Q)}),p=t.Record({set_dapp_controllers_call_result:t.Opt(C),create_sns_neuron_recipes_result:t.Opt(c),settle_community_fund_participation_result:t.Opt(q),error_message:t.Opt(t.Text),settle_neurons_fund_participation_result:t.Opt(M),set_mode_call_result:t.Opt(j),sweep_icp_result:t.Opt(c),claim_neuron_result:t.Opt(c),sweep_sns_result:t.Opt(c)}),H=t.Record({auto_finalize_swap_response:t.Opt(p),has_auto_finalize_been_attempted:t.Opt(t.Bool),is_auto_finalize_enabled:t.Opt(t.Bool)}),J=t.Record({principal_id:t.Opt(t.Principal)}),m=t.Record({transfer_fee_paid_e8s:t.Opt(t.Nat64),transfer_start_timestamp_seconds:t.Nat64,amount_e8s:t.Nat64,amount_transferred_e8s:t.Opt(t.Nat64),transfer_success_timestamp_seconds:t.Nat64}),_=t.Record({icp:t.Opt(m),has_created_neuron_recipes:t.Opt(t.Bool)}),K=t.Record({buyer_state:t.Opt(_)}),W=t.Record({buyers_total:t.Nat64}),X=t.Variant({stopped:t.Null,stopping:t.Null,running:t.Null}),Y=t.Record({freezing_threshold:t.Nat,controllers:t.Vec(t.Principal),memory_allocation:t.Nat,compute_allocation:t.Nat}),Z=t.Record({status:X,memory_size:t.Nat,cycles:t.Nat,settings:Y,idle_cycles_burned_per_day:t.Nat,module_hash:t.Opt(t.Vec(t.Nat8))}),$=t.Record({sns_tokens_per_icp:t.Opt(t.Float64),buyer_total_icp_e8s:t.Opt(t.Nat64),cf_participant_count:t.Opt(t.Nat64),neurons_fund_participation_icp_e8s:t.Opt(t.Nat64),direct_participation_icp_e8s:t.Opt(t.Nat64),direct_participant_count:t.Opt(t.Nat64),cf_neuron_count:t.Opt(t.Nat64)}),I=t.Record({init:t.Opt(O)}),D=t.Record({decentralization_sale_open_timestamp_seconds:t.Opt(t.Nat64),lifecycle:t.Opt(t.Int32),decentralization_swap_termination_timestamp_seconds:t.Opt(t.Nat64)}),L=t.Record({owner:t.Opt(t.Principal),subaccount:t.Opt(t.Vec(t.Nat8))}),N=t.Record({creation_time:t.Nat64,ticket_id:t.Nat64,account:t.Opt(L),amount_icp_e8s:t.Nat64}),d=t.Record({ticket:t.Opt(N)}),tt=t.Record({error_type:t.Opt(t.Int32)}),et=t.Variant({Ok:d,Err:tt}),nt=t.Record({result:t.Opt(et)}),u=t.Record({min_participant_icp_e8s:t.Nat64,neuron_basket_construction_parameters:t.Opt(i),max_icp_e8s:t.Nat64,swap_due_timestamp_seconds:t.Nat64,min_participants:t.Nat32,sns_token_e8s:t.Nat64,sale_delay_seconds:t.Opt(t.Nat64),max_participant_icp_e8s:t.Nat64,min_direct_participation_icp_e8s:t.Opt(t.Nat64),min_icp_e8s:t.Nat64,max_direct_participation_icp_e8s:t.Opt(t.Nat64)}),it=t.Record({params:t.Opt(u)}),st=t.Record({id:t.Vec(t.Nat8)}),rt=t.Record({dissolve_delay_seconds:t.Nat64,memo:t.Nat64,followees:t.Vec(st)}),at=t.Record({hotkey_principal:t.Text,nns_neuron_id:t.Nat64}),ot=t.Record({buyer_principal:t.Text}),ct=t.Variant({CommunityFund:at,Direct:ot}),R=t.Record({sns:t.Opt(m),claimed_status:t.Opt(t.Int32),neuron_attributes:t.Opt(rt),investor:t.Opt(ct)}),pt=t.Record({auto_finalize_swap_response:t.Opt(p),neuron_recipes:t.Vec(R),next_ticket_id:t.Opt(t.Nat64),decentralization_sale_open_timestamp_seconds:t.Opt(t.Nat64),finalize_swap_in_progress:t.Opt(t.Bool),cf_participants:t.Vec(a),init:t.Opt(O),already_tried_to_auto_finalize:t.Opt(t.Bool),neurons_fund_participation_icp_e8s:t.Opt(t.Nat64),purge_old_tickets_last_completion_timestamp_nanoseconds:t.Opt(t.Nat64),direct_participation_icp_e8s:t.Opt(t.Nat64),lifecycle:t.Int32,purge_old_tickets_next_principal:t.Opt(t.Vec(t.Nat8)),decentralization_swap_termination_timestamp_seconds:t.Opt(t.Nat64),buyers:t.Vec(t.Tuple(t.Text,_)),params:t.Opt(u),open_sns_token_swap_proposal_id:t.Opt(t.Nat64)}),_t=t.Record({sns_tokens_per_icp:t.Float32,buyer_total_icp_e8s:t.Nat64,cf_participant_count:t.Opt(t.Nat64),neurons_fund_participation_icp_e8s:t.Opt(t.Nat64),direct_participation_icp_e8s:t.Opt(t.Nat64),direct_participant_count:t.Opt(t.Nat64),cf_neuron_count:t.Opt(t.Nat64)}),dt=t.Record({swap:t.Opt(pt),derived:t.Opt(_t)}),ut=t.Record({offset:t.Opt(t.Nat64),limit:t.Opt(t.Nat32)}),lt=t.Record({offset:t.Opt(t.Nat32),limit:t.Opt(t.Nat32)}),Ot=t.Record({participation:t.Opt(_),participant_id:t.Opt(t.Principal)}),mt=t.Record({participants:t.Vec(Ot)}),Nt=t.Record({offset:t.Opt(t.Nat64),limit:t.Opt(t.Nat32)}),Rt=t.Record({sns_neuron_recipes:t.Vec(R)}),ft=t.Record({subaccount:t.Opt(t.Vec(t.Nat8)),amount_icp_e8s:t.Nat64}),yt=t.Record({min_amount_icp_e8s_included:t.Nat64,max_amount_icp_e8s_included:t.Nat64}),kt=t.Record({invalid_user_amount:t.Opt(yt),existing_ticket:t.Opt(N),error_type:t.Int32}),Tt=t.Variant({Ok:d,Err:kt}),xt=t.Record({result:t.Opt(Tt)}),St=t.Record({cf_participants:t.Vec(a),params:t.Opt(u),open_sns_token_swap_proposal_id:t.Opt(t.Nat64)}),gt=t.Record({confirmation_text:t.Opt(t.Text),buyer:t.Text}),wt=t.Record({icp_accepted_participation_e8s:t.Nat64,icp_ledger_account_balance_e8s:t.Nat64});return t.Service({error_refund_icp:t.Func([g],[b],[]),finalize_swap:t.Func([t.Record({})],[p],[]),get_auto_finalization_status:t.Func([t.Record({})],[H],[]),get_buyer_state:t.Func([J],[K],[]),get_buyers_total:t.Func([t.Record({})],[W],[]),get_canister_status:t.Func([t.Record({})],[Z],[]),get_derived_state:t.Func([t.Record({})],[$],[]),get_init:t.Func([t.Record({})],[I],[]),get_lifecycle:t.Func([t.Record({})],[D],[]),get_open_ticket:t.Func([t.Record({})],[nt],[]),get_sale_parameters:t.Func([t.Record({})],[it],[]),get_state:t.Func([t.Record({})],[dt],[]),list_community_fund_participants:t.Func([ut],[l],[]),list_direct_participants:t.Func([lt],[mt],[]),list_sns_neuron_recipes:t.Func([Nt],[Rt],[]),new_sale_ticket:t.Func([ft],[xt],[]),notify_payment_failure:t.Func([t.Record({})],[d],[]),open:t.Func([St],[t.Record({})],[]),refresh_buyer_tokens:t.Func([gt],[wt],[])})};var Pt=({IDL:t})=>{let i=t.Record({dissolve_delay_interval_seconds:t.Nat64,count:t.Nat64}),e=t.Record({slope_numerator:t.Opt(t.Nat64),intercept_icp_e8s:t.Opt(t.Nat64),from_direct_participation_icp_e8s:t.Opt(t.Nat64),slope_denominator:t.Opt(t.Nat64),to_direct_participation_icp_e8s:t.Opt(t.Nat64)}),n=t.Record({serialized_representation:t.Opt(t.Text)}),s=t.Record({coefficient_intervals:t.Vec(e),max_neurons_fund_participation_icp_e8s:t.Opt(t.Nat64),min_direct_participation_threshold_icp_e8s:t.Opt(t.Nat64),ideal_matched_participation_function:t.Opt(n)}),r=t.Record({has_created_neuron_recipes:t.Opt(t.Bool),nns_neuron_id:t.Nat64,amount_icp_e8s:t.Nat64}),a=t.Record({hotkey_principal:t.Text,cf_neurons:t.Vec(r)}),l=t.Record({cf_participants:t.Vec(a)}),S=t.Record({iso_codes:t.Vec(t.Text)}),O=t.Record({nns_proposal_id:t.Opt(t.Nat64),sns_root_canister_id:t.Text,neurons_fund_participation:t.Opt(t.Bool),min_participant_icp_e8s:t.Opt(t.Nat64),neuron_basket_construction_parameters:t.Opt(i),fallback_controller_principal_ids:t.Vec(t.Text),max_icp_e8s:t.Opt(t.Nat64),neuron_minimum_stake_e8s:t.Opt(t.Nat64),confirmation_text:t.Opt(t.Text),swap_start_timestamp_seconds:t.Opt(t.Nat64),swap_due_timestamp_seconds:t.Opt(t.Nat64),min_participants:t.Opt(t.Nat32),sns_token_e8s:t.Opt(t.Nat64),nns_governance_canister_id:t.Text,transaction_fee_e8s:t.Opt(t.Nat64),icp_ledger_canister_id:t.Text,sns_ledger_canister_id:t.Text,neurons_fund_participation_constraints:t.Opt(s),neurons_fund_participants:t.Opt(l),should_auto_finalize:t.Opt(t.Bool),max_participant_icp_e8s:t.Opt(t.Nat64),sns_governance_canister_id:t.Text,min_direct_participation_icp_e8s:t.Opt(t.Nat64),restricted_countries:t.Opt(S),min_icp_e8s:t.Opt(t.Nat64),max_direct_participation_icp_e8s:t.Opt(t.Nat64)}),g=t.Record({source_principal_id:t.Opt(t.Principal)}),w=t.Record({block_height:t.Opt(t.Nat64)}),h=t.Record({description:t.Opt(t.Text),error_type:t.Opt(t.Int32)}),P=t.Variant({Ok:w,Err:h}),b=t.Record({result:t.Opt(P)}),o=t.Record({code:t.Opt(t.Int32),description:t.Text}),F=t.Record({err:t.Opt(o),dapp_canister_id:t.Opt(t.Principal)}),v=t.Record({failed_updates:t.Vec(F)}),V=t.Variant({Ok:v,Err:o}),C=t.Record({possibility:t.Opt(V)}),c=t.Record({failure:t.Nat32,skipped:t.Nat32,invalid:t.Nat32,success:t.Nat32,global_failures:t.Nat32}),B=t.Record({error_message:t.Text,error_type:t.Int32}),z=t.Record({governance_error:t.Opt(B)}),E=t.Variant({Ok:z,Err:o}),q=t.Record({possibility:t.Opt(E)}),G=t.Record({neurons_fund_participation_icp_e8s:t.Opt(t.Nat64),neurons_fund_neurons_count:t.Opt(t.Nat64)}),A=t.Record({message:t.Opt(t.Text)}),U=t.Variant({Ok:G,Err:A}),M=t.Record({possibility:t.Opt(U)}),Q=t.Variant({Ok:t.Record({}),Err:o}),j=t.Record({possibility:t.Opt(Q)}),p=t.Record({set_dapp_controllers_call_result:t.Opt(C),create_sns_neuron_recipes_result:t.Opt(c),settle_community_fund_participation_result:t.Opt(q),error_message:t.Opt(t.Text),settle_neurons_fund_participation_result:t.Opt(M),set_mode_call_result:t.Opt(j),sweep_icp_result:t.Opt(c),claim_neuron_result:t.Opt(c),sweep_sns_result:t.Opt(c)}),H=t.Record({auto_finalize_swap_response:t.Opt(p),has_auto_finalize_been_attempted:t.Opt(t.Bool),is_auto_finalize_enabled:t.Opt(t.Bool)}),J=t.Record({principal_id:t.Opt(t.Principal)}),m=t.Record({transfer_fee_paid_e8s:t.Opt(t.Nat64),transfer_start_timestamp_seconds:t.Nat64,amount_e8s:t.Nat64,amount_transferred_e8s:t.Opt(t.Nat64),transfer_success_timestamp_seconds:t.Nat64}),_=t.Record({icp:t.Opt(m),has_created_neuron_recipes:t.Opt(t.Bool)}),K=t.Record({buyer_state:t.Opt(_)}),W=t.Record({buyers_total:t.Nat64}),X=t.Variant({stopped:t.Null,stopping:t.Null,running:t.Null}),Y=t.Record({freezing_threshold:t.Nat,controllers:t.Vec(t.Principal),memory_allocation:t.Nat,compute_allocation:t.Nat}),Z=t.Record({status:X,memory_size:t.Nat,cycles:t.Nat,settings:Y,idle_cycles_burned_per_day:t.Nat,module_hash:t.Opt(t.Vec(t.Nat8))}),$=t.Record({sns_tokens_per_icp:t.Opt(t.Float64),buyer_total_icp_e8s:t.Opt(t.Nat64),cf_participant_count:t.Opt(t.Nat64),neurons_fund_participation_icp_e8s:t.Opt(t.Nat64),direct_participation_icp_e8s:t.Opt(t.Nat64),direct_participant_count:t.Opt(t.Nat64),cf_neuron_count:t.Opt(t.Nat64)}),I=t.Record({init:t.Opt(O)}),D=t.Record({decentralization_sale_open_timestamp_seconds:t.Opt(t.Nat64),lifecycle:t.Opt(t.Int32),decentralization_swap_termination_timestamp_seconds:t.Opt(t.Nat64)}),L=t.Record({owner:t.Opt(t.Principal),subaccount:t.Opt(t.Vec(t.Nat8))}),N=t.Record({creation_time:t.Nat64,ticket_id:t.Nat64,account:t.Opt(L),amount_icp_e8s:t.Nat64}),d=t.Record({ticket:t.Opt(N)}),tt=t.Record({error_type:t.Opt(t.Int32)}),et=t.Variant({Ok:d,Err:tt}),nt=t.Record({result:t.Opt(et)}),u=t.Record({min_participant_icp_e8s:t.Nat64,neuron_basket_construction_parameters:t.Opt(i),max_icp_e8s:t.Nat64,swap_due_timestamp_seconds:t.Nat64,min_participants:t.Nat32,sns_token_e8s:t.Nat64,sale_delay_seconds:t.Opt(t.Nat64),max_participant_icp_e8s:t.Nat64,min_direct_participation_icp_e8s:t.Opt(t.Nat64),min_icp_e8s:t.Nat64,max_direct_participation_icp_e8s:t.Opt(t.Nat64)}),it=t.Record({params:t.Opt(u)}),st=t.Record({id:t.Vec(t.Nat8)}),rt=t.Record({dissolve_delay_seconds:t.Nat64,memo:t.Nat64,followees:t.Vec(st)}),at=t.Record({hotkey_principal:t.Text,nns_neuron_id:t.Nat64}),ot=t.Record({buyer_principal:t.Text}),ct=t.Variant({CommunityFund:at,Direct:ot}),R=t.Record({sns:t.Opt(m),claimed_status:t.Opt(t.Int32),neuron_attributes:t.Opt(rt),investor:t.Opt(ct)}),pt=t.Record({auto_finalize_swap_response:t.Opt(p),neuron_recipes:t.Vec(R),next_ticket_id:t.Opt(t.Nat64),decentralization_sale_open_timestamp_seconds:t.Opt(t.Nat64),finalize_swap_in_progress:t.Opt(t.Bool),cf_participants:t.Vec(a),init:t.Opt(O),already_tried_to_auto_finalize:t.Opt(t.Bool),neurons_fund_participation_icp_e8s:t.Opt(t.Nat64),purge_old_tickets_last_completion_timestamp_nanoseconds:t.Opt(t.Nat64),direct_participation_icp_e8s:t.Opt(t.Nat64),lifecycle:t.Int32,purge_old_tickets_next_principal:t.Opt(t.Vec(t.Nat8)),decentralization_swap_termination_timestamp_seconds:t.Opt(t.Nat64),buyers:t.Vec(t.Tuple(t.Text,_)),params:t.Opt(u),open_sns_token_swap_proposal_id:t.Opt(t.Nat64)}),_t=t.Record({sns_tokens_per_icp:t.Float32,buyer_total_icp_e8s:t.Nat64,cf_participant_count:t.Opt(t.Nat64),neurons_fund_participation_icp_e8s:t.Opt(t.Nat64),direct_participation_icp_e8s:t.Opt(t.Nat64),direct_participant_count:t.Opt(t.Nat64),cf_neuron_count:t.Opt(t.Nat64)}),dt=t.Record({swap:t.Opt(pt),derived:t.Opt(_t)}),ut=t.Record({offset:t.Opt(t.Nat64),limit:t.Opt(t.Nat32)}),lt=t.Record({offset:t.Opt(t.Nat32),limit:t.Opt(t.Nat32)}),Ot=t.Record({participation:t.Opt(_),participant_id:t.Opt(t.Principal)}),mt=t.Record({participants:t.Vec(Ot)}),Nt=t.Record({offset:t.Opt(t.Nat64),limit:t.Opt(t.Nat32)}),Rt=t.Record({sns_neuron_recipes:t.Vec(R)}),ft=t.Record({subaccount:t.Opt(t.Vec(t.Nat8)),amount_icp_e8s:t.Nat64}),yt=t.Record({min_amount_icp_e8s_included:t.Nat64,max_amount_icp_e8s_included:t.Nat64}),kt=t.Record({invalid_user_amount:t.Opt(yt),existing_ticket:t.Opt(N),error_type:t.Int32}),Tt=t.Variant({Ok:d,Err:kt}),xt=t.Record({result:t.Opt(Tt)}),St=t.Record({cf_participants:t.Vec(a),params:t.Opt(u),open_sns_token_swap_proposal_id:t.Opt(t.Nat64)}),gt=t.Record({confirmation_text:t.Opt(t.Text),buyer:t.Text}),wt=t.Record({icp_accepted_participation_e8s:t.Nat64,icp_ledger_account_balance_e8s:t.Nat64});return t.Service({error_refund_icp:t.Func([g],[b],[]),finalize_swap:t.Func([t.Record({})],[p],[]),get_auto_finalization_status:t.Func([t.Record({})],[H],["query"]),get_buyer_state:t.Func([J],[K],["query"]),get_buyers_total:t.Func([t.Record({})],[W],[]),get_canister_status:t.Func([t.Record({})],[Z],[]),get_derived_state:t.Func([t.Record({})],[$],["query"]),get_init:t.Func([t.Record({})],[I],["query"]),get_lifecycle:t.Func([t.Record({})],[D],["query"]),get_open_ticket:t.Func([t.Record({})],[nt],["query"]),get_sale_parameters:t.Func([t.Record({})],[it],["query"]),get_state:t.Func([t.Record({})],[dt],["query"]),list_community_fund_participants:t.Func([ut],[l],["query"]),list_direct_participants:t.Func([lt],[mt],["query"]),list_sns_neuron_recipes:t.Func([Nt],[Rt],["query"]),new_sale_ticket:t.Func([ft],[xt],[]),notify_payment_failure:t.Func([t.Record({})],[d],[]),open:t.Func([St],[t.Record({})],[]),refresh_buyer_tokens:t.Func([gt],[wt],[])})};var bt=({subaccount:t,amount_icp_e8s:i})=>({subaccount:t===void 0?[]:[t],amount_icp_e8s:i});var y=class extends Error{constructor(e){super();this.methodName=e}};var k=class extends Error{constructor({errorType:i,invalidUserAmount:e,existingTicket:n}){super(),this.errorType=i,this.invalidUserAmount=e,this.existingTicket=n}},T=class extends Error{constructor(e){super();this.errorType=e}};import{nonNullish as Vt}from"@dfinity/utils";var Ft=t=>{if(typeof t=="object"&&Vt(t)&&"message"in t){let i=t.message;return i.includes("has no update method")||i.includes("has no query method")}return!1};var vt=class t extends Ct{constructor(){super(...arguments);this.state=e=>this.caller(e).get_state({});this.notifyPaymentFailure=async()=>{let{ticket:e}=await this.caller({certified:!0}).notify_payment_failure({});return f(e)};this.notifyParticipation=async e=>await this.caller({certified:!0}).refresh_buyer_tokens(e);this.getUserCommitment=async e=>{let{buyer_state:n}=await this.caller({certified:e.certified}).get_buyer_state({principal_id:e.principal_id});return f(n)};this.getDerivedState=async({certified:e})=>this.caller({certified:e}).get_derived_state({});this.getSaleParameters=async({certified:e})=>this.caller({certified:e}).get_sale_parameters({});this.getOpenTicket=async e=>{let{result:n}=await this.caller({certified:e.certified}).get_open_ticket({}),s=x(n);if("Ok"in s)return f(s.Ok.ticket);let r=x(s?.Err?.error_type);throw new T(r)};this.newSaleTicket=async e=>{let n=bt(e),{result:s}=await this.caller({certified:!0}).new_sale_ticket(n),r=x(s);if("Ok"in r)return x(r.Ok.ticket);let a=r.Err;throw new k({errorType:a.error_type,invalidUserAmount:f(a.invalid_user_amount??[]),existingTicket:f(a.existing_ticket??[])})};this.getLifecycle=async e=>this.caller(e).get_lifecycle({});this.getFinalizationStatus=async e=>{try{return await this.caller(e).get_auto_finalization_status({})}catch(n){throw Ft(n)?new y("getFinalizationStatus"):n}}}static create(e){let{service:n,certifiedService:s,canisterId:r}=Bt({options:e,idlFactory:Pt,certifiedIdlFactory:ht});return new t(r,n,s)}};export{y as a,k as b,T as c,vt as d};
|
|
2
|
+
//# sourceMappingURL=chunk-34CD4QJG.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/swap.canister.ts", "../../candid/sns_swap.certified.idl.js", "../../candid/sns_swap.idl.js", "../../src/converters/swap.converters.ts", "../../src/errors/common.errors.ts", "../../src/errors/swap.errors.ts", "../../src/utils/error.utils.ts"],
|
|
4
|
+
"sourcesContent": ["import type { QueryParams } from \"@dfinity/utils\";\nimport {\n Canister,\n createServices,\n fromDefinedNullable,\n fromNullable,\n} from \"@dfinity/utils\";\nimport type {\n BuyerState,\n GetAutoFinalizationStatusResponse,\n GetBuyerStateRequest,\n GetDerivedStateResponse,\n GetLifecycleResponse,\n GetSaleParametersResponse,\n GetStateResponse,\n RefreshBuyerTokensRequest,\n RefreshBuyerTokensResponse,\n _SERVICE as SnsSwapService,\n Ticket,\n} from \"../candid/sns_swap\";\nimport { idlFactory as certifiedIdlFactory } from \"../candid/sns_swap.certified.idl\";\nimport { idlFactory } from \"../candid/sns_swap.idl\";\nimport { toNewSaleTicketRequest } from \"./converters/swap.converters\";\nimport { UnsupportedMethodError } from \"./errors/common.errors\";\nimport {\n SnsSwapGetOpenTicketError,\n SnsSwapNewTicketError,\n} from \"./errors/swap.errors\";\nimport type { SnsCanisterOptions } from \"./types/canister.options\";\nimport type { NewSaleTicketParams } from \"./types/swap.params\";\nimport { isMethodNotSupportedError } from \"./utils/error.utils\";\n\nexport class SnsSwapCanister extends Canister<SnsSwapService> {\n static create(options: SnsCanisterOptions<SnsSwapService>) {\n const { service, certifiedService, canisterId } =\n createServices<SnsSwapService>({\n options,\n idlFactory,\n certifiedIdlFactory,\n });\n\n return new SnsSwapCanister(canisterId, service, certifiedService);\n }\n\n /**\n * Get the state of the swap\n */\n state = (params: QueryParams): Promise<GetStateResponse> =>\n this.caller(params).get_state({});\n\n /**\n * Notify of the payment failure to remove the ticket\n */\n notifyPaymentFailure = async (): Promise<Ticket | undefined> => {\n const { ticket } = await this.caller({\n certified: true,\n }).notify_payment_failure({});\n return fromNullable(ticket);\n };\n\n /**\n * Notify of the user participating in the swap\n */\n notifyParticipation = async (\n params: RefreshBuyerTokensRequest,\n ): Promise<RefreshBuyerTokensResponse> =>\n await this.caller({ certified: true }).refresh_buyer_tokens(params);\n\n /**\n * Get user commitment\n */\n getUserCommitment = async (\n params: GetBuyerStateRequest & QueryParams,\n ): Promise<BuyerState | undefined> => {\n const { buyer_state } = await this.caller({\n certified: params.certified,\n }).get_buyer_state({ principal_id: params.principal_id });\n return fromNullable(buyer_state);\n };\n\n /**\n * Get sale buyers state\n */\n getDerivedState = async ({\n certified,\n }: QueryParams): Promise<GetDerivedStateResponse> => {\n return this.caller({ certified }).get_derived_state({});\n };\n\n /**\n * Get sale parameters\n */\n getSaleParameters = async ({\n certified,\n }: QueryParams): Promise<GetSaleParametersResponse> => {\n return this.caller({ certified }).get_sale_parameters({});\n };\n\n /**\n * Return a sale ticket if created and not yet removed (payment flow)\n */\n getOpenTicket = async (params: QueryParams): Promise<Ticket | undefined> => {\n const { result: response } = await this.caller({\n certified: params.certified,\n }).get_open_ticket({});\n const result = fromDefinedNullable(response);\n\n if (\"Ok\" in result) {\n return fromNullable(result.Ok.ticket);\n }\n\n const errorType = fromDefinedNullable(result?.Err?.error_type);\n throw new SnsSwapGetOpenTicketError(errorType);\n };\n\n /**\n * Create a sale ticket (payment flow)\n */\n newSaleTicket = async (params: NewSaleTicketParams): Promise<Ticket> => {\n const request = toNewSaleTicketRequest(params);\n const { result: response } = await this.caller({\n certified: true,\n }).new_sale_ticket(request);\n\n const result = fromDefinedNullable(response);\n\n if (\"Ok\" in result) {\n return fromDefinedNullable(result.Ok.ticket);\n }\n\n const errorData = result.Err;\n const error = new SnsSwapNewTicketError({\n errorType: errorData.error_type,\n invalidUserAmount: fromNullable(errorData.invalid_user_amount ?? []),\n existingTicket: fromNullable(errorData.existing_ticket ?? []),\n });\n\n throw error;\n };\n\n /**\n * Get sale lifecycle state\n */\n getLifecycle = async (params: QueryParams): Promise<GetLifecycleResponse> => {\n return this.caller(params).get_lifecycle({});\n };\n\n /**\n * Get sale lifecycle state\n */\n getFinalizationStatus = async (\n params: QueryParams,\n ): Promise<GetAutoFinalizationStatusResponse> => {\n try {\n return await this.caller(params).get_auto_finalization_status({});\n } catch (error) {\n // Throw a custom error if the method is not supported by the canister\n if (isMethodNotSupportedError(error)) {\n throw new UnsupportedMethodError(\"getFinalizationStatus\");\n }\n throw error;\n }\n };\n}\n", "/* Do not edit. Compiled with ./scripts/compile-idl-js from packages/sns/candid/sns_swap.did */\nexport const idlFactory = ({ IDL }) => {\n const NeuronBasketConstructionParameters = IDL.Record({\n 'dissolve_delay_interval_seconds' : IDL.Nat64,\n 'count' : IDL.Nat64,\n });\n const LinearScalingCoefficient = IDL.Record({\n 'slope_numerator' : IDL.Opt(IDL.Nat64),\n 'intercept_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'from_direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'slope_denominator' : IDL.Opt(IDL.Nat64),\n 'to_direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n });\n const IdealMatchedParticipationFunction = IDL.Record({\n 'serialized_representation' : IDL.Opt(IDL.Text),\n });\n const NeuronsFundParticipationConstraints = IDL.Record({\n 'coefficient_intervals' : IDL.Vec(LinearScalingCoefficient),\n 'max_neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'min_direct_participation_threshold_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'ideal_matched_participation_function' : IDL.Opt(\n IdealMatchedParticipationFunction\n ),\n });\n const CfNeuron = IDL.Record({\n 'has_created_neuron_recipes' : IDL.Opt(IDL.Bool),\n 'nns_neuron_id' : IDL.Nat64,\n 'amount_icp_e8s' : IDL.Nat64,\n });\n const CfParticipant = IDL.Record({\n 'hotkey_principal' : IDL.Text,\n 'cf_neurons' : IDL.Vec(CfNeuron),\n });\n const NeuronsFundParticipants = IDL.Record({\n 'cf_participants' : IDL.Vec(CfParticipant),\n });\n const Countries = IDL.Record({ 'iso_codes' : IDL.Vec(IDL.Text) });\n const Init = IDL.Record({\n 'nns_proposal_id' : IDL.Opt(IDL.Nat64),\n 'sns_root_canister_id' : IDL.Text,\n 'neurons_fund_participation' : IDL.Opt(IDL.Bool),\n 'min_participant_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'neuron_basket_construction_parameters' : IDL.Opt(\n NeuronBasketConstructionParameters\n ),\n 'fallback_controller_principal_ids' : IDL.Vec(IDL.Text),\n 'max_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'neuron_minimum_stake_e8s' : IDL.Opt(IDL.Nat64),\n 'confirmation_text' : IDL.Opt(IDL.Text),\n 'swap_start_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n 'swap_due_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n 'min_participants' : IDL.Opt(IDL.Nat32),\n 'sns_token_e8s' : IDL.Opt(IDL.Nat64),\n 'nns_governance_canister_id' : IDL.Text,\n 'transaction_fee_e8s' : IDL.Opt(IDL.Nat64),\n 'icp_ledger_canister_id' : IDL.Text,\n 'sns_ledger_canister_id' : IDL.Text,\n 'neurons_fund_participation_constraints' : IDL.Opt(\n NeuronsFundParticipationConstraints\n ),\n 'neurons_fund_participants' : IDL.Opt(NeuronsFundParticipants),\n 'should_auto_finalize' : IDL.Opt(IDL.Bool),\n 'max_participant_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'sns_governance_canister_id' : IDL.Text,\n 'min_direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'restricted_countries' : IDL.Opt(Countries),\n 'min_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'max_direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n });\n const ErrorRefundIcpRequest = IDL.Record({\n 'source_principal_id' : IDL.Opt(IDL.Principal),\n });\n const Ok = IDL.Record({ 'block_height' : IDL.Opt(IDL.Nat64) });\n const Err = IDL.Record({\n 'description' : IDL.Opt(IDL.Text),\n 'error_type' : IDL.Opt(IDL.Int32),\n });\n const Result = IDL.Variant({ 'Ok' : Ok, 'Err' : Err });\n const ErrorRefundIcpResponse = IDL.Record({ 'result' : IDL.Opt(Result) });\n const CanisterCallError = IDL.Record({\n 'code' : IDL.Opt(IDL.Int32),\n 'description' : IDL.Text,\n });\n const FailedUpdate = IDL.Record({\n 'err' : IDL.Opt(CanisterCallError),\n 'dapp_canister_id' : IDL.Opt(IDL.Principal),\n });\n const SetDappControllersResponse = IDL.Record({\n 'failed_updates' : IDL.Vec(FailedUpdate),\n });\n const Possibility = IDL.Variant({\n 'Ok' : SetDappControllersResponse,\n 'Err' : CanisterCallError,\n });\n const SetDappControllersCallResult = IDL.Record({\n 'possibility' : IDL.Opt(Possibility),\n });\n const SweepResult = IDL.Record({\n 'failure' : IDL.Nat32,\n 'skipped' : IDL.Nat32,\n 'invalid' : IDL.Nat32,\n 'success' : IDL.Nat32,\n 'global_failures' : IDL.Nat32,\n });\n const GovernanceError = IDL.Record({\n 'error_message' : IDL.Text,\n 'error_type' : IDL.Int32,\n });\n const Response = IDL.Record({\n 'governance_error' : IDL.Opt(GovernanceError),\n });\n const Possibility_1 = IDL.Variant({\n 'Ok' : Response,\n 'Err' : CanisterCallError,\n });\n const SettleCommunityFundParticipationResult = IDL.Record({\n 'possibility' : IDL.Opt(Possibility_1),\n });\n const Ok_1 = IDL.Record({\n 'neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'neurons_fund_neurons_count' : IDL.Opt(IDL.Nat64),\n });\n const Error = IDL.Record({ 'message' : IDL.Opt(IDL.Text) });\n const Possibility_2 = IDL.Variant({ 'Ok' : Ok_1, 'Err' : Error });\n const SettleNeuronsFundParticipationResult = IDL.Record({\n 'possibility' : IDL.Opt(Possibility_2),\n });\n const Possibility_3 = IDL.Variant({\n 'Ok' : IDL.Record({}),\n 'Err' : CanisterCallError,\n });\n const SetModeCallResult = IDL.Record({\n 'possibility' : IDL.Opt(Possibility_3),\n });\n const FinalizeSwapResponse = IDL.Record({\n 'set_dapp_controllers_call_result' : IDL.Opt(SetDappControllersCallResult),\n 'create_sns_neuron_recipes_result' : IDL.Opt(SweepResult),\n 'settle_community_fund_participation_result' : IDL.Opt(\n SettleCommunityFundParticipationResult\n ),\n 'error_message' : IDL.Opt(IDL.Text),\n 'settle_neurons_fund_participation_result' : IDL.Opt(\n SettleNeuronsFundParticipationResult\n ),\n 'set_mode_call_result' : IDL.Opt(SetModeCallResult),\n 'sweep_icp_result' : IDL.Opt(SweepResult),\n 'claim_neuron_result' : IDL.Opt(SweepResult),\n 'sweep_sns_result' : IDL.Opt(SweepResult),\n });\n const GetAutoFinalizationStatusResponse = IDL.Record({\n 'auto_finalize_swap_response' : IDL.Opt(FinalizeSwapResponse),\n 'has_auto_finalize_been_attempted' : IDL.Opt(IDL.Bool),\n 'is_auto_finalize_enabled' : IDL.Opt(IDL.Bool),\n });\n const GetBuyerStateRequest = IDL.Record({\n 'principal_id' : IDL.Opt(IDL.Principal),\n });\n const TransferableAmount = IDL.Record({\n 'transfer_fee_paid_e8s' : IDL.Opt(IDL.Nat64),\n 'transfer_start_timestamp_seconds' : IDL.Nat64,\n 'amount_e8s' : IDL.Nat64,\n 'amount_transferred_e8s' : IDL.Opt(IDL.Nat64),\n 'transfer_success_timestamp_seconds' : IDL.Nat64,\n });\n const BuyerState = IDL.Record({\n 'icp' : IDL.Opt(TransferableAmount),\n 'has_created_neuron_recipes' : IDL.Opt(IDL.Bool),\n });\n const GetBuyerStateResponse = IDL.Record({\n 'buyer_state' : IDL.Opt(BuyerState),\n });\n const GetBuyersTotalResponse = IDL.Record({ 'buyers_total' : IDL.Nat64 });\n const CanisterStatusType = IDL.Variant({\n 'stopped' : IDL.Null,\n 'stopping' : IDL.Null,\n 'running' : IDL.Null,\n });\n const DefiniteCanisterSettingsArgs = IDL.Record({\n 'freezing_threshold' : IDL.Nat,\n 'controllers' : IDL.Vec(IDL.Principal),\n 'memory_allocation' : IDL.Nat,\n 'compute_allocation' : IDL.Nat,\n });\n const CanisterStatusResultV2 = IDL.Record({\n 'status' : CanisterStatusType,\n 'memory_size' : IDL.Nat,\n 'cycles' : IDL.Nat,\n 'settings' : DefiniteCanisterSettingsArgs,\n 'idle_cycles_burned_per_day' : IDL.Nat,\n 'module_hash' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const GetDerivedStateResponse = IDL.Record({\n 'sns_tokens_per_icp' : IDL.Opt(IDL.Float64),\n 'buyer_total_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'cf_participant_count' : IDL.Opt(IDL.Nat64),\n 'neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'direct_participant_count' : IDL.Opt(IDL.Nat64),\n 'cf_neuron_count' : IDL.Opt(IDL.Nat64),\n });\n const GetInitResponse = IDL.Record({ 'init' : IDL.Opt(Init) });\n const GetLifecycleResponse = IDL.Record({\n 'decentralization_sale_open_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n 'lifecycle' : IDL.Opt(IDL.Int32),\n 'decentralization_swap_termination_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n });\n const Icrc1Account = IDL.Record({\n 'owner' : IDL.Opt(IDL.Principal),\n 'subaccount' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const Ticket = IDL.Record({\n 'creation_time' : IDL.Nat64,\n 'ticket_id' : IDL.Nat64,\n 'account' : IDL.Opt(Icrc1Account),\n 'amount_icp_e8s' : IDL.Nat64,\n });\n const Ok_2 = IDL.Record({ 'ticket' : IDL.Opt(Ticket) });\n const Err_1 = IDL.Record({ 'error_type' : IDL.Opt(IDL.Int32) });\n const Result_1 = IDL.Variant({ 'Ok' : Ok_2, 'Err' : Err_1 });\n const GetOpenTicketResponse = IDL.Record({ 'result' : IDL.Opt(Result_1) });\n const Params = IDL.Record({\n 'min_participant_icp_e8s' : IDL.Nat64,\n 'neuron_basket_construction_parameters' : IDL.Opt(\n NeuronBasketConstructionParameters\n ),\n 'max_icp_e8s' : IDL.Nat64,\n 'swap_due_timestamp_seconds' : IDL.Nat64,\n 'min_participants' : IDL.Nat32,\n 'sns_token_e8s' : IDL.Nat64,\n 'sale_delay_seconds' : IDL.Opt(IDL.Nat64),\n 'max_participant_icp_e8s' : IDL.Nat64,\n 'min_direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'min_icp_e8s' : IDL.Nat64,\n 'max_direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n });\n const GetSaleParametersResponse = IDL.Record({ 'params' : IDL.Opt(Params) });\n const NeuronId = IDL.Record({ 'id' : IDL.Vec(IDL.Nat8) });\n const NeuronAttributes = IDL.Record({\n 'dissolve_delay_seconds' : IDL.Nat64,\n 'memo' : IDL.Nat64,\n 'followees' : IDL.Vec(NeuronId),\n });\n const CfInvestment = IDL.Record({\n 'hotkey_principal' : IDL.Text,\n 'nns_neuron_id' : IDL.Nat64,\n });\n const DirectInvestment = IDL.Record({ 'buyer_principal' : IDL.Text });\n const Investor = IDL.Variant({\n 'CommunityFund' : CfInvestment,\n 'Direct' : DirectInvestment,\n });\n const SnsNeuronRecipe = IDL.Record({\n 'sns' : IDL.Opt(TransferableAmount),\n 'claimed_status' : IDL.Opt(IDL.Int32),\n 'neuron_attributes' : IDL.Opt(NeuronAttributes),\n 'investor' : IDL.Opt(Investor),\n });\n const Swap = IDL.Record({\n 'auto_finalize_swap_response' : IDL.Opt(FinalizeSwapResponse),\n 'neuron_recipes' : IDL.Vec(SnsNeuronRecipe),\n 'next_ticket_id' : IDL.Opt(IDL.Nat64),\n 'decentralization_sale_open_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n 'finalize_swap_in_progress' : IDL.Opt(IDL.Bool),\n 'cf_participants' : IDL.Vec(CfParticipant),\n 'init' : IDL.Opt(Init),\n 'already_tried_to_auto_finalize' : IDL.Opt(IDL.Bool),\n 'neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'purge_old_tickets_last_completion_timestamp_nanoseconds' : IDL.Opt(\n IDL.Nat64\n ),\n 'direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'lifecycle' : IDL.Int32,\n 'purge_old_tickets_next_principal' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'decentralization_swap_termination_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n 'buyers' : IDL.Vec(IDL.Tuple(IDL.Text, BuyerState)),\n 'params' : IDL.Opt(Params),\n 'open_sns_token_swap_proposal_id' : IDL.Opt(IDL.Nat64),\n });\n const DerivedState = IDL.Record({\n 'sns_tokens_per_icp' : IDL.Float32,\n 'buyer_total_icp_e8s' : IDL.Nat64,\n 'cf_participant_count' : IDL.Opt(IDL.Nat64),\n 'neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'direct_participant_count' : IDL.Opt(IDL.Nat64),\n 'cf_neuron_count' : IDL.Opt(IDL.Nat64),\n });\n const GetStateResponse = IDL.Record({\n 'swap' : IDL.Opt(Swap),\n 'derived' : IDL.Opt(DerivedState),\n });\n const ListCommunityFundParticipantsRequest = IDL.Record({\n 'offset' : IDL.Opt(IDL.Nat64),\n 'limit' : IDL.Opt(IDL.Nat32),\n });\n const ListDirectParticipantsRequest = IDL.Record({\n 'offset' : IDL.Opt(IDL.Nat32),\n 'limit' : IDL.Opt(IDL.Nat32),\n });\n const Participant = IDL.Record({\n 'participation' : IDL.Opt(BuyerState),\n 'participant_id' : IDL.Opt(IDL.Principal),\n });\n const ListDirectParticipantsResponse = IDL.Record({\n 'participants' : IDL.Vec(Participant),\n });\n const ListSnsNeuronRecipesRequest = IDL.Record({\n 'offset' : IDL.Opt(IDL.Nat64),\n 'limit' : IDL.Opt(IDL.Nat32),\n });\n const ListSnsNeuronRecipesResponse = IDL.Record({\n 'sns_neuron_recipes' : IDL.Vec(SnsNeuronRecipe),\n });\n const NewSaleTicketRequest = IDL.Record({\n 'subaccount' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'amount_icp_e8s' : IDL.Nat64,\n });\n const InvalidUserAmount = IDL.Record({\n 'min_amount_icp_e8s_included' : IDL.Nat64,\n 'max_amount_icp_e8s_included' : IDL.Nat64,\n });\n const Err_2 = IDL.Record({\n 'invalid_user_amount' : IDL.Opt(InvalidUserAmount),\n 'existing_ticket' : IDL.Opt(Ticket),\n 'error_type' : IDL.Int32,\n });\n const Result_2 = IDL.Variant({ 'Ok' : Ok_2, 'Err' : Err_2 });\n const NewSaleTicketResponse = IDL.Record({ 'result' : IDL.Opt(Result_2) });\n const OpenRequest = IDL.Record({\n 'cf_participants' : IDL.Vec(CfParticipant),\n 'params' : IDL.Opt(Params),\n 'open_sns_token_swap_proposal_id' : IDL.Opt(IDL.Nat64),\n });\n const RefreshBuyerTokensRequest = IDL.Record({\n 'confirmation_text' : IDL.Opt(IDL.Text),\n 'buyer' : IDL.Text,\n });\n const RefreshBuyerTokensResponse = IDL.Record({\n 'icp_accepted_participation_e8s' : IDL.Nat64,\n 'icp_ledger_account_balance_e8s' : IDL.Nat64,\n });\n return IDL.Service({\n 'error_refund_icp' : IDL.Func(\n [ErrorRefundIcpRequest],\n [ErrorRefundIcpResponse],\n [],\n ),\n 'finalize_swap' : IDL.Func([IDL.Record({})], [FinalizeSwapResponse], []),\n 'get_auto_finalization_status' : IDL.Func(\n [IDL.Record({})],\n [GetAutoFinalizationStatusResponse],\n [],\n ),\n 'get_buyer_state' : IDL.Func(\n [GetBuyerStateRequest],\n [GetBuyerStateResponse],\n [],\n ),\n 'get_buyers_total' : IDL.Func(\n [IDL.Record({})],\n [GetBuyersTotalResponse],\n [],\n ),\n 'get_canister_status' : IDL.Func(\n [IDL.Record({})],\n [CanisterStatusResultV2],\n [],\n ),\n 'get_derived_state' : IDL.Func(\n [IDL.Record({})],\n [GetDerivedStateResponse],\n [],\n ),\n 'get_init' : IDL.Func([IDL.Record({})], [GetInitResponse], []),\n 'get_lifecycle' : IDL.Func([IDL.Record({})], [GetLifecycleResponse], []),\n 'get_open_ticket' : IDL.Func([IDL.Record({})], [GetOpenTicketResponse], []),\n 'get_sale_parameters' : IDL.Func(\n [IDL.Record({})],\n [GetSaleParametersResponse],\n [],\n ),\n 'get_state' : IDL.Func([IDL.Record({})], [GetStateResponse], []),\n 'list_community_fund_participants' : IDL.Func(\n [ListCommunityFundParticipantsRequest],\n [NeuronsFundParticipants],\n [],\n ),\n 'list_direct_participants' : IDL.Func(\n [ListDirectParticipantsRequest],\n [ListDirectParticipantsResponse],\n [],\n ),\n 'list_sns_neuron_recipes' : IDL.Func(\n [ListSnsNeuronRecipesRequest],\n [ListSnsNeuronRecipesResponse],\n [],\n ),\n 'new_sale_ticket' : IDL.Func(\n [NewSaleTicketRequest],\n [NewSaleTicketResponse],\n [],\n ),\n 'notify_payment_failure' : IDL.Func([IDL.Record({})], [Ok_2], []),\n 'open' : IDL.Func([OpenRequest], [IDL.Record({})], []),\n 'refresh_buyer_tokens' : IDL.Func(\n [RefreshBuyerTokensRequest],\n [RefreshBuyerTokensResponse],\n [],\n ),\n });\n};\nexport const init = ({ IDL }) => {\n const NeuronBasketConstructionParameters = IDL.Record({\n 'dissolve_delay_interval_seconds' : IDL.Nat64,\n 'count' : IDL.Nat64,\n });\n const LinearScalingCoefficient = IDL.Record({\n 'slope_numerator' : IDL.Opt(IDL.Nat64),\n 'intercept_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'from_direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'slope_denominator' : IDL.Opt(IDL.Nat64),\n 'to_direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n });\n const IdealMatchedParticipationFunction = IDL.Record({\n 'serialized_representation' : IDL.Opt(IDL.Text),\n });\n const NeuronsFundParticipationConstraints = IDL.Record({\n 'coefficient_intervals' : IDL.Vec(LinearScalingCoefficient),\n 'max_neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'min_direct_participation_threshold_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'ideal_matched_participation_function' : IDL.Opt(\n IdealMatchedParticipationFunction\n ),\n });\n const CfNeuron = IDL.Record({\n 'has_created_neuron_recipes' : IDL.Opt(IDL.Bool),\n 'nns_neuron_id' : IDL.Nat64,\n 'amount_icp_e8s' : IDL.Nat64,\n });\n const CfParticipant = IDL.Record({\n 'hotkey_principal' : IDL.Text,\n 'cf_neurons' : IDL.Vec(CfNeuron),\n });\n const NeuronsFundParticipants = IDL.Record({\n 'cf_participants' : IDL.Vec(CfParticipant),\n });\n const Countries = IDL.Record({ 'iso_codes' : IDL.Vec(IDL.Text) });\n const Init = IDL.Record({\n 'nns_proposal_id' : IDL.Opt(IDL.Nat64),\n 'sns_root_canister_id' : IDL.Text,\n 'neurons_fund_participation' : IDL.Opt(IDL.Bool),\n 'min_participant_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'neuron_basket_construction_parameters' : IDL.Opt(\n NeuronBasketConstructionParameters\n ),\n 'fallback_controller_principal_ids' : IDL.Vec(IDL.Text),\n 'max_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'neuron_minimum_stake_e8s' : IDL.Opt(IDL.Nat64),\n 'confirmation_text' : IDL.Opt(IDL.Text),\n 'swap_start_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n 'swap_due_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n 'min_participants' : IDL.Opt(IDL.Nat32),\n 'sns_token_e8s' : IDL.Opt(IDL.Nat64),\n 'nns_governance_canister_id' : IDL.Text,\n 'transaction_fee_e8s' : IDL.Opt(IDL.Nat64),\n 'icp_ledger_canister_id' : IDL.Text,\n 'sns_ledger_canister_id' : IDL.Text,\n 'neurons_fund_participation_constraints' : IDL.Opt(\n NeuronsFundParticipationConstraints\n ),\n 'neurons_fund_participants' : IDL.Opt(NeuronsFundParticipants),\n 'should_auto_finalize' : IDL.Opt(IDL.Bool),\n 'max_participant_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'sns_governance_canister_id' : IDL.Text,\n 'min_direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'restricted_countries' : IDL.Opt(Countries),\n 'min_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'max_direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n });\n return [Init];\n};\n", "/* Do not edit. Compiled with ./scripts/compile-idl-js from packages/sns/candid/sns_swap.did */\nexport const idlFactory = ({ IDL }) => {\n const NeuronBasketConstructionParameters = IDL.Record({\n 'dissolve_delay_interval_seconds' : IDL.Nat64,\n 'count' : IDL.Nat64,\n });\n const LinearScalingCoefficient = IDL.Record({\n 'slope_numerator' : IDL.Opt(IDL.Nat64),\n 'intercept_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'from_direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'slope_denominator' : IDL.Opt(IDL.Nat64),\n 'to_direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n });\n const IdealMatchedParticipationFunction = IDL.Record({\n 'serialized_representation' : IDL.Opt(IDL.Text),\n });\n const NeuronsFundParticipationConstraints = IDL.Record({\n 'coefficient_intervals' : IDL.Vec(LinearScalingCoefficient),\n 'max_neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'min_direct_participation_threshold_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'ideal_matched_participation_function' : IDL.Opt(\n IdealMatchedParticipationFunction\n ),\n });\n const CfNeuron = IDL.Record({\n 'has_created_neuron_recipes' : IDL.Opt(IDL.Bool),\n 'nns_neuron_id' : IDL.Nat64,\n 'amount_icp_e8s' : IDL.Nat64,\n });\n const CfParticipant = IDL.Record({\n 'hotkey_principal' : IDL.Text,\n 'cf_neurons' : IDL.Vec(CfNeuron),\n });\n const NeuronsFundParticipants = IDL.Record({\n 'cf_participants' : IDL.Vec(CfParticipant),\n });\n const Countries = IDL.Record({ 'iso_codes' : IDL.Vec(IDL.Text) });\n const Init = IDL.Record({\n 'nns_proposal_id' : IDL.Opt(IDL.Nat64),\n 'sns_root_canister_id' : IDL.Text,\n 'neurons_fund_participation' : IDL.Opt(IDL.Bool),\n 'min_participant_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'neuron_basket_construction_parameters' : IDL.Opt(\n NeuronBasketConstructionParameters\n ),\n 'fallback_controller_principal_ids' : IDL.Vec(IDL.Text),\n 'max_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'neuron_minimum_stake_e8s' : IDL.Opt(IDL.Nat64),\n 'confirmation_text' : IDL.Opt(IDL.Text),\n 'swap_start_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n 'swap_due_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n 'min_participants' : IDL.Opt(IDL.Nat32),\n 'sns_token_e8s' : IDL.Opt(IDL.Nat64),\n 'nns_governance_canister_id' : IDL.Text,\n 'transaction_fee_e8s' : IDL.Opt(IDL.Nat64),\n 'icp_ledger_canister_id' : IDL.Text,\n 'sns_ledger_canister_id' : IDL.Text,\n 'neurons_fund_participation_constraints' : IDL.Opt(\n NeuronsFundParticipationConstraints\n ),\n 'neurons_fund_participants' : IDL.Opt(NeuronsFundParticipants),\n 'should_auto_finalize' : IDL.Opt(IDL.Bool),\n 'max_participant_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'sns_governance_canister_id' : IDL.Text,\n 'min_direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'restricted_countries' : IDL.Opt(Countries),\n 'min_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'max_direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n });\n const ErrorRefundIcpRequest = IDL.Record({\n 'source_principal_id' : IDL.Opt(IDL.Principal),\n });\n const Ok = IDL.Record({ 'block_height' : IDL.Opt(IDL.Nat64) });\n const Err = IDL.Record({\n 'description' : IDL.Opt(IDL.Text),\n 'error_type' : IDL.Opt(IDL.Int32),\n });\n const Result = IDL.Variant({ 'Ok' : Ok, 'Err' : Err });\n const ErrorRefundIcpResponse = IDL.Record({ 'result' : IDL.Opt(Result) });\n const CanisterCallError = IDL.Record({\n 'code' : IDL.Opt(IDL.Int32),\n 'description' : IDL.Text,\n });\n const FailedUpdate = IDL.Record({\n 'err' : IDL.Opt(CanisterCallError),\n 'dapp_canister_id' : IDL.Opt(IDL.Principal),\n });\n const SetDappControllersResponse = IDL.Record({\n 'failed_updates' : IDL.Vec(FailedUpdate),\n });\n const Possibility = IDL.Variant({\n 'Ok' : SetDappControllersResponse,\n 'Err' : CanisterCallError,\n });\n const SetDappControllersCallResult = IDL.Record({\n 'possibility' : IDL.Opt(Possibility),\n });\n const SweepResult = IDL.Record({\n 'failure' : IDL.Nat32,\n 'skipped' : IDL.Nat32,\n 'invalid' : IDL.Nat32,\n 'success' : IDL.Nat32,\n 'global_failures' : IDL.Nat32,\n });\n const GovernanceError = IDL.Record({\n 'error_message' : IDL.Text,\n 'error_type' : IDL.Int32,\n });\n const Response = IDL.Record({\n 'governance_error' : IDL.Opt(GovernanceError),\n });\n const Possibility_1 = IDL.Variant({\n 'Ok' : Response,\n 'Err' : CanisterCallError,\n });\n const SettleCommunityFundParticipationResult = IDL.Record({\n 'possibility' : IDL.Opt(Possibility_1),\n });\n const Ok_1 = IDL.Record({\n 'neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'neurons_fund_neurons_count' : IDL.Opt(IDL.Nat64),\n });\n const Error = IDL.Record({ 'message' : IDL.Opt(IDL.Text) });\n const Possibility_2 = IDL.Variant({ 'Ok' : Ok_1, 'Err' : Error });\n const SettleNeuronsFundParticipationResult = IDL.Record({\n 'possibility' : IDL.Opt(Possibility_2),\n });\n const Possibility_3 = IDL.Variant({\n 'Ok' : IDL.Record({}),\n 'Err' : CanisterCallError,\n });\n const SetModeCallResult = IDL.Record({\n 'possibility' : IDL.Opt(Possibility_3),\n });\n const FinalizeSwapResponse = IDL.Record({\n 'set_dapp_controllers_call_result' : IDL.Opt(SetDappControllersCallResult),\n 'create_sns_neuron_recipes_result' : IDL.Opt(SweepResult),\n 'settle_community_fund_participation_result' : IDL.Opt(\n SettleCommunityFundParticipationResult\n ),\n 'error_message' : IDL.Opt(IDL.Text),\n 'settle_neurons_fund_participation_result' : IDL.Opt(\n SettleNeuronsFundParticipationResult\n ),\n 'set_mode_call_result' : IDL.Opt(SetModeCallResult),\n 'sweep_icp_result' : IDL.Opt(SweepResult),\n 'claim_neuron_result' : IDL.Opt(SweepResult),\n 'sweep_sns_result' : IDL.Opt(SweepResult),\n });\n const GetAutoFinalizationStatusResponse = IDL.Record({\n 'auto_finalize_swap_response' : IDL.Opt(FinalizeSwapResponse),\n 'has_auto_finalize_been_attempted' : IDL.Opt(IDL.Bool),\n 'is_auto_finalize_enabled' : IDL.Opt(IDL.Bool),\n });\n const GetBuyerStateRequest = IDL.Record({\n 'principal_id' : IDL.Opt(IDL.Principal),\n });\n const TransferableAmount = IDL.Record({\n 'transfer_fee_paid_e8s' : IDL.Opt(IDL.Nat64),\n 'transfer_start_timestamp_seconds' : IDL.Nat64,\n 'amount_e8s' : IDL.Nat64,\n 'amount_transferred_e8s' : IDL.Opt(IDL.Nat64),\n 'transfer_success_timestamp_seconds' : IDL.Nat64,\n });\n const BuyerState = IDL.Record({\n 'icp' : IDL.Opt(TransferableAmount),\n 'has_created_neuron_recipes' : IDL.Opt(IDL.Bool),\n });\n const GetBuyerStateResponse = IDL.Record({\n 'buyer_state' : IDL.Opt(BuyerState),\n });\n const GetBuyersTotalResponse = IDL.Record({ 'buyers_total' : IDL.Nat64 });\n const CanisterStatusType = IDL.Variant({\n 'stopped' : IDL.Null,\n 'stopping' : IDL.Null,\n 'running' : IDL.Null,\n });\n const DefiniteCanisterSettingsArgs = IDL.Record({\n 'freezing_threshold' : IDL.Nat,\n 'controllers' : IDL.Vec(IDL.Principal),\n 'memory_allocation' : IDL.Nat,\n 'compute_allocation' : IDL.Nat,\n });\n const CanisterStatusResultV2 = IDL.Record({\n 'status' : CanisterStatusType,\n 'memory_size' : IDL.Nat,\n 'cycles' : IDL.Nat,\n 'settings' : DefiniteCanisterSettingsArgs,\n 'idle_cycles_burned_per_day' : IDL.Nat,\n 'module_hash' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const GetDerivedStateResponse = IDL.Record({\n 'sns_tokens_per_icp' : IDL.Opt(IDL.Float64),\n 'buyer_total_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'cf_participant_count' : IDL.Opt(IDL.Nat64),\n 'neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'direct_participant_count' : IDL.Opt(IDL.Nat64),\n 'cf_neuron_count' : IDL.Opt(IDL.Nat64),\n });\n const GetInitResponse = IDL.Record({ 'init' : IDL.Opt(Init) });\n const GetLifecycleResponse = IDL.Record({\n 'decentralization_sale_open_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n 'lifecycle' : IDL.Opt(IDL.Int32),\n 'decentralization_swap_termination_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n });\n const Icrc1Account = IDL.Record({\n 'owner' : IDL.Opt(IDL.Principal),\n 'subaccount' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n });\n const Ticket = IDL.Record({\n 'creation_time' : IDL.Nat64,\n 'ticket_id' : IDL.Nat64,\n 'account' : IDL.Opt(Icrc1Account),\n 'amount_icp_e8s' : IDL.Nat64,\n });\n const Ok_2 = IDL.Record({ 'ticket' : IDL.Opt(Ticket) });\n const Err_1 = IDL.Record({ 'error_type' : IDL.Opt(IDL.Int32) });\n const Result_1 = IDL.Variant({ 'Ok' : Ok_2, 'Err' : Err_1 });\n const GetOpenTicketResponse = IDL.Record({ 'result' : IDL.Opt(Result_1) });\n const Params = IDL.Record({\n 'min_participant_icp_e8s' : IDL.Nat64,\n 'neuron_basket_construction_parameters' : IDL.Opt(\n NeuronBasketConstructionParameters\n ),\n 'max_icp_e8s' : IDL.Nat64,\n 'swap_due_timestamp_seconds' : IDL.Nat64,\n 'min_participants' : IDL.Nat32,\n 'sns_token_e8s' : IDL.Nat64,\n 'sale_delay_seconds' : IDL.Opt(IDL.Nat64),\n 'max_participant_icp_e8s' : IDL.Nat64,\n 'min_direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'min_icp_e8s' : IDL.Nat64,\n 'max_direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n });\n const GetSaleParametersResponse = IDL.Record({ 'params' : IDL.Opt(Params) });\n const NeuronId = IDL.Record({ 'id' : IDL.Vec(IDL.Nat8) });\n const NeuronAttributes = IDL.Record({\n 'dissolve_delay_seconds' : IDL.Nat64,\n 'memo' : IDL.Nat64,\n 'followees' : IDL.Vec(NeuronId),\n });\n const CfInvestment = IDL.Record({\n 'hotkey_principal' : IDL.Text,\n 'nns_neuron_id' : IDL.Nat64,\n });\n const DirectInvestment = IDL.Record({ 'buyer_principal' : IDL.Text });\n const Investor = IDL.Variant({\n 'CommunityFund' : CfInvestment,\n 'Direct' : DirectInvestment,\n });\n const SnsNeuronRecipe = IDL.Record({\n 'sns' : IDL.Opt(TransferableAmount),\n 'claimed_status' : IDL.Opt(IDL.Int32),\n 'neuron_attributes' : IDL.Opt(NeuronAttributes),\n 'investor' : IDL.Opt(Investor),\n });\n const Swap = IDL.Record({\n 'auto_finalize_swap_response' : IDL.Opt(FinalizeSwapResponse),\n 'neuron_recipes' : IDL.Vec(SnsNeuronRecipe),\n 'next_ticket_id' : IDL.Opt(IDL.Nat64),\n 'decentralization_sale_open_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n 'finalize_swap_in_progress' : IDL.Opt(IDL.Bool),\n 'cf_participants' : IDL.Vec(CfParticipant),\n 'init' : IDL.Opt(Init),\n 'already_tried_to_auto_finalize' : IDL.Opt(IDL.Bool),\n 'neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'purge_old_tickets_last_completion_timestamp_nanoseconds' : IDL.Opt(\n IDL.Nat64\n ),\n 'direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'lifecycle' : IDL.Int32,\n 'purge_old_tickets_next_principal' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'decentralization_swap_termination_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n 'buyers' : IDL.Vec(IDL.Tuple(IDL.Text, BuyerState)),\n 'params' : IDL.Opt(Params),\n 'open_sns_token_swap_proposal_id' : IDL.Opt(IDL.Nat64),\n });\n const DerivedState = IDL.Record({\n 'sns_tokens_per_icp' : IDL.Float32,\n 'buyer_total_icp_e8s' : IDL.Nat64,\n 'cf_participant_count' : IDL.Opt(IDL.Nat64),\n 'neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'direct_participant_count' : IDL.Opt(IDL.Nat64),\n 'cf_neuron_count' : IDL.Opt(IDL.Nat64),\n });\n const GetStateResponse = IDL.Record({\n 'swap' : IDL.Opt(Swap),\n 'derived' : IDL.Opt(DerivedState),\n });\n const ListCommunityFundParticipantsRequest = IDL.Record({\n 'offset' : IDL.Opt(IDL.Nat64),\n 'limit' : IDL.Opt(IDL.Nat32),\n });\n const ListDirectParticipantsRequest = IDL.Record({\n 'offset' : IDL.Opt(IDL.Nat32),\n 'limit' : IDL.Opt(IDL.Nat32),\n });\n const Participant = IDL.Record({\n 'participation' : IDL.Opt(BuyerState),\n 'participant_id' : IDL.Opt(IDL.Principal),\n });\n const ListDirectParticipantsResponse = IDL.Record({\n 'participants' : IDL.Vec(Participant),\n });\n const ListSnsNeuronRecipesRequest = IDL.Record({\n 'offset' : IDL.Opt(IDL.Nat64),\n 'limit' : IDL.Opt(IDL.Nat32),\n });\n const ListSnsNeuronRecipesResponse = IDL.Record({\n 'sns_neuron_recipes' : IDL.Vec(SnsNeuronRecipe),\n });\n const NewSaleTicketRequest = IDL.Record({\n 'subaccount' : IDL.Opt(IDL.Vec(IDL.Nat8)),\n 'amount_icp_e8s' : IDL.Nat64,\n });\n const InvalidUserAmount = IDL.Record({\n 'min_amount_icp_e8s_included' : IDL.Nat64,\n 'max_amount_icp_e8s_included' : IDL.Nat64,\n });\n const Err_2 = IDL.Record({\n 'invalid_user_amount' : IDL.Opt(InvalidUserAmount),\n 'existing_ticket' : IDL.Opt(Ticket),\n 'error_type' : IDL.Int32,\n });\n const Result_2 = IDL.Variant({ 'Ok' : Ok_2, 'Err' : Err_2 });\n const NewSaleTicketResponse = IDL.Record({ 'result' : IDL.Opt(Result_2) });\n const OpenRequest = IDL.Record({\n 'cf_participants' : IDL.Vec(CfParticipant),\n 'params' : IDL.Opt(Params),\n 'open_sns_token_swap_proposal_id' : IDL.Opt(IDL.Nat64),\n });\n const RefreshBuyerTokensRequest = IDL.Record({\n 'confirmation_text' : IDL.Opt(IDL.Text),\n 'buyer' : IDL.Text,\n });\n const RefreshBuyerTokensResponse = IDL.Record({\n 'icp_accepted_participation_e8s' : IDL.Nat64,\n 'icp_ledger_account_balance_e8s' : IDL.Nat64,\n });\n return IDL.Service({\n 'error_refund_icp' : IDL.Func(\n [ErrorRefundIcpRequest],\n [ErrorRefundIcpResponse],\n [],\n ),\n 'finalize_swap' : IDL.Func([IDL.Record({})], [FinalizeSwapResponse], []),\n 'get_auto_finalization_status' : IDL.Func(\n [IDL.Record({})],\n [GetAutoFinalizationStatusResponse],\n ['query'],\n ),\n 'get_buyer_state' : IDL.Func(\n [GetBuyerStateRequest],\n [GetBuyerStateResponse],\n ['query'],\n ),\n 'get_buyers_total' : IDL.Func(\n [IDL.Record({})],\n [GetBuyersTotalResponse],\n [],\n ),\n 'get_canister_status' : IDL.Func(\n [IDL.Record({})],\n [CanisterStatusResultV2],\n [],\n ),\n 'get_derived_state' : IDL.Func(\n [IDL.Record({})],\n [GetDerivedStateResponse],\n ['query'],\n ),\n 'get_init' : IDL.Func([IDL.Record({})], [GetInitResponse], ['query']),\n 'get_lifecycle' : IDL.Func(\n [IDL.Record({})],\n [GetLifecycleResponse],\n ['query'],\n ),\n 'get_open_ticket' : IDL.Func(\n [IDL.Record({})],\n [GetOpenTicketResponse],\n ['query'],\n ),\n 'get_sale_parameters' : IDL.Func(\n [IDL.Record({})],\n [GetSaleParametersResponse],\n ['query'],\n ),\n 'get_state' : IDL.Func([IDL.Record({})], [GetStateResponse], ['query']),\n 'list_community_fund_participants' : IDL.Func(\n [ListCommunityFundParticipantsRequest],\n [NeuronsFundParticipants],\n ['query'],\n ),\n 'list_direct_participants' : IDL.Func(\n [ListDirectParticipantsRequest],\n [ListDirectParticipantsResponse],\n ['query'],\n ),\n 'list_sns_neuron_recipes' : IDL.Func(\n [ListSnsNeuronRecipesRequest],\n [ListSnsNeuronRecipesResponse],\n ['query'],\n ),\n 'new_sale_ticket' : IDL.Func(\n [NewSaleTicketRequest],\n [NewSaleTicketResponse],\n [],\n ),\n 'notify_payment_failure' : IDL.Func([IDL.Record({})], [Ok_2], []),\n 'open' : IDL.Func([OpenRequest], [IDL.Record({})], []),\n 'refresh_buyer_tokens' : IDL.Func(\n [RefreshBuyerTokensRequest],\n [RefreshBuyerTokensResponse],\n [],\n ),\n });\n};\nexport const init = ({ IDL }) => {\n const NeuronBasketConstructionParameters = IDL.Record({\n 'dissolve_delay_interval_seconds' : IDL.Nat64,\n 'count' : IDL.Nat64,\n });\n const LinearScalingCoefficient = IDL.Record({\n 'slope_numerator' : IDL.Opt(IDL.Nat64),\n 'intercept_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'from_direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'slope_denominator' : IDL.Opt(IDL.Nat64),\n 'to_direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n });\n const IdealMatchedParticipationFunction = IDL.Record({\n 'serialized_representation' : IDL.Opt(IDL.Text),\n });\n const NeuronsFundParticipationConstraints = IDL.Record({\n 'coefficient_intervals' : IDL.Vec(LinearScalingCoefficient),\n 'max_neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'min_direct_participation_threshold_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'ideal_matched_participation_function' : IDL.Opt(\n IdealMatchedParticipationFunction\n ),\n });\n const CfNeuron = IDL.Record({\n 'has_created_neuron_recipes' : IDL.Opt(IDL.Bool),\n 'nns_neuron_id' : IDL.Nat64,\n 'amount_icp_e8s' : IDL.Nat64,\n });\n const CfParticipant = IDL.Record({\n 'hotkey_principal' : IDL.Text,\n 'cf_neurons' : IDL.Vec(CfNeuron),\n });\n const NeuronsFundParticipants = IDL.Record({\n 'cf_participants' : IDL.Vec(CfParticipant),\n });\n const Countries = IDL.Record({ 'iso_codes' : IDL.Vec(IDL.Text) });\n const Init = IDL.Record({\n 'nns_proposal_id' : IDL.Opt(IDL.Nat64),\n 'sns_root_canister_id' : IDL.Text,\n 'neurons_fund_participation' : IDL.Opt(IDL.Bool),\n 'min_participant_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'neuron_basket_construction_parameters' : IDL.Opt(\n NeuronBasketConstructionParameters\n ),\n 'fallback_controller_principal_ids' : IDL.Vec(IDL.Text),\n 'max_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'neuron_minimum_stake_e8s' : IDL.Opt(IDL.Nat64),\n 'confirmation_text' : IDL.Opt(IDL.Text),\n 'swap_start_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n 'swap_due_timestamp_seconds' : IDL.Opt(IDL.Nat64),\n 'min_participants' : IDL.Opt(IDL.Nat32),\n 'sns_token_e8s' : IDL.Opt(IDL.Nat64),\n 'nns_governance_canister_id' : IDL.Text,\n 'transaction_fee_e8s' : IDL.Opt(IDL.Nat64),\n 'icp_ledger_canister_id' : IDL.Text,\n 'sns_ledger_canister_id' : IDL.Text,\n 'neurons_fund_participation_constraints' : IDL.Opt(\n NeuronsFundParticipationConstraints\n ),\n 'neurons_fund_participants' : IDL.Opt(NeuronsFundParticipants),\n 'should_auto_finalize' : IDL.Opt(IDL.Bool),\n 'max_participant_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'sns_governance_canister_id' : IDL.Text,\n 'min_direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'restricted_countries' : IDL.Opt(Countries),\n 'min_icp_e8s' : IDL.Opt(IDL.Nat64),\n 'max_direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64),\n });\n return [Init];\n};\n", "import type { NewSaleTicketRequest } from \"../../candid/sns_swap\";\nimport type { NewSaleTicketParams } from \"../types/swap.params\";\n\n// Helper for building `NewSaleTicketRequest` structure\nexport const toNewSaleTicketRequest = ({\n subaccount,\n amount_icp_e8s,\n}: NewSaleTicketParams): NewSaleTicketRequest => ({\n subaccount: subaccount === undefined ? [] : [subaccount],\n amount_icp_e8s,\n});\n", "// This is possible specially in SNS projects/\n// Because they share the same canisters but in different versions.\nexport class UnsupportedMethodError extends Error {\n constructor(public readonly methodName: string) {\n super();\n }\n}\n", "import type { InvalidUserAmount, Ticket } from \"../../candid/sns_swap\";\nimport type {\n GetOpenTicketErrorType,\n NewSaleTicketResponseErrorType,\n} from \"../enums/swap.enums\";\n\nexport class SnsSwapNewTicketError extends Error {\n public errorType: NewSaleTicketResponseErrorType;\n public invalidUserAmount?: InvalidUserAmount;\n public existingTicket?: Ticket;\n\n constructor({\n errorType,\n invalidUserAmount,\n existingTicket,\n }: {\n errorType: NewSaleTicketResponseErrorType;\n invalidUserAmount?: InvalidUserAmount;\n existingTicket?: Ticket;\n }) {\n super();\n this.errorType = errorType;\n this.invalidUserAmount = invalidUserAmount;\n this.existingTicket = existingTicket;\n }\n}\n\nexport class SnsSwapGetOpenTicketError extends Error {\n constructor(public errorType: GetOpenTicketErrorType) {\n super();\n }\n}\n", "import { nonNullish } from \"@dfinity/utils\";\n\n/**\n * Identifies errors of method not being present in the canister.\n *\n * This is useful because SNS projects have different versions of SNS canisters.\n * Therefore, what works in the latest version might not work in the previous one.\n *\n * Error message example: \"Call was rejected:\n * Request ID: 3a6ef904b35fd19721c95c3df2b0b00b8abefba7f0ad188f5c472809b772c914\n * Reject code: 3\n * Reject text: Canister 75ffu-oaaaa-aaaaa-aabbq-cai has no update method 'get_auto_finalization_status'\"\n */\nexport const isMethodNotSupportedError = (err: unknown): boolean => {\n if (typeof err === \"object\" && nonNullish(err) && \"message\" in err) {\n const message = err.message as string;\n return (\n message.includes(\"has no update method\") ||\n message.includes(\"has no query method\")\n );\n }\n return false;\n};\n"],
|
|
5
|
+
"mappings": "AACA,OACE,YAAAA,GACA,kBAAAC,GACA,uBAAAC,EACA,gBAAAC,MACK,iBCLA,IAAMC,GAAa,CAAC,CAAE,IAAAC,CAAI,IAAM,CACrC,IAAMC,EAAqCD,EAAI,OAAO,CACpD,gCAAoCA,EAAI,MACxC,MAAUA,EAAI,KAChB,CAAC,EACKE,EAA2BF,EAAI,OAAO,CAC1C,gBAAoBA,EAAI,IAAIA,EAAI,KAAK,EACrC,kBAAsBA,EAAI,IAAIA,EAAI,KAAK,EACvC,kCAAsCA,EAAI,IAAIA,EAAI,KAAK,EACvD,kBAAsBA,EAAI,IAAIA,EAAI,KAAK,EACvC,gCAAoCA,EAAI,IAAIA,EAAI,KAAK,CACvD,CAAC,EACKG,EAAoCH,EAAI,OAAO,CACnD,0BAA8BA,EAAI,IAAIA,EAAI,IAAI,CAChD,CAAC,EACKI,EAAsCJ,EAAI,OAAO,CACrD,sBAA0BA,EAAI,IAAIE,CAAwB,EAC1D,uCAA2CF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EAC5CC,GAA+B,CAC7B,QAAAJ,EACA,WAAAK,GACA,oBAAAA,EACF,CAAC,EAEH,OAAO,IAAIxB,EAAgBsB,EAAYF,EAASC,CAAgB,CAClE,CAyHF",
|
|
6
|
+
"names": ["Canister", "createServices", "fromDefinedNullable", "fromNullable", "idlFactory", "IDL", "NeuronBasketConstructionParameters", "LinearScalingCoefficient", "IdealMatchedParticipationFunction", "NeuronsFundParticipationConstraints", "CfNeuron", "CfParticipant", "NeuronsFundParticipants", "Countries", "Init", "ErrorRefundIcpRequest", "Ok", "Err", "Result", "ErrorRefundIcpResponse", "CanisterCallError", "FailedUpdate", "SetDappControllersResponse", "Possibility", "SetDappControllersCallResult", "SweepResult", "GovernanceError", "Response", "Possibility_1", "SettleCommunityFundParticipationResult", "Ok_1", "Error", "Possibility_2", "SettleNeuronsFundParticipationResult", "Possibility_3", "SetModeCallResult", "FinalizeSwapResponse", "GetAutoFinalizationStatusResponse", "GetBuyerStateRequest", "TransferableAmount", "BuyerState", "GetBuyerStateResponse", "GetBuyersTotalResponse", "CanisterStatusType", "DefiniteCanisterSettingsArgs", "CanisterStatusResultV2", "GetDerivedStateResponse", "GetInitResponse", "GetLifecycleResponse", "Icrc1Account", "Ticket", "Ok_2", "Err_1", "Result_1", "GetOpenTicketResponse", "Params", "GetSaleParametersResponse", "NeuronId", "NeuronAttributes", "CfInvestment", "DirectInvestment", "Investor", "SnsNeuronRecipe", "Swap", "DerivedState", "GetStateResponse", "ListCommunityFundParticipantsRequest", "ListDirectParticipantsRequest", "Participant", "ListDirectParticipantsResponse", "ListSnsNeuronRecipesRequest", "ListSnsNeuronRecipesResponse", "NewSaleTicketRequest", "InvalidUserAmount", "Err_2", "Result_2", "NewSaleTicketResponse", "OpenRequest", "RefreshBuyerTokensRequest", "RefreshBuyerTokensResponse", "idlFactory", "IDL", "NeuronBasketConstructionParameters", "LinearScalingCoefficient", "IdealMatchedParticipationFunction", "NeuronsFundParticipationConstraints", "CfNeuron", "CfParticipant", "NeuronsFundParticipants", "Countries", "Init", "ErrorRefundIcpRequest", "Ok", "Err", "Result", "ErrorRefundIcpResponse", "CanisterCallError", "FailedUpdate", "SetDappControllersResponse", "Possibility", "SetDappControllersCallResult", "SweepResult", "GovernanceError", "Response", "Possibility_1", "SettleCommunityFundParticipationResult", "Ok_1", "Error", "Possibility_2", "SettleNeuronsFundParticipationResult", "Possibility_3", "SetModeCallResult", "FinalizeSwapResponse", "GetAutoFinalizationStatusResponse", "GetBuyerStateRequest", "TransferableAmount", "BuyerState", "GetBuyerStateResponse", "GetBuyersTotalResponse", "CanisterStatusType", "DefiniteCanisterSettingsArgs", "CanisterStatusResultV2", "GetDerivedStateResponse", "GetInitResponse", "GetLifecycleResponse", "Icrc1Account", "Ticket", "Ok_2", "Err_1", "Result_1", "GetOpenTicketResponse", "Params", "GetSaleParametersResponse", "NeuronId", "NeuronAttributes", "CfInvestment", "DirectInvestment", "Investor", "SnsNeuronRecipe", "Swap", "DerivedState", "GetStateResponse", "ListCommunityFundParticipantsRequest", "ListDirectParticipantsRequest", "Participant", "ListDirectParticipantsResponse", "ListSnsNeuronRecipesRequest", "ListSnsNeuronRecipesResponse", "NewSaleTicketRequest", "InvalidUserAmount", "Err_2", "Result_2", "NewSaleTicketResponse", "OpenRequest", "RefreshBuyerTokensRequest", "RefreshBuyerTokensResponse", "toNewSaleTicketRequest", "subaccount", "amount_icp_e8s", "UnsupportedMethodError", "methodName", "SnsSwapNewTicketError", "errorType", "invalidUserAmount", "existingTicket", "SnsSwapGetOpenTicketError", "nonNullish", "isMethodNotSupportedError", "err", "message", "SnsSwapCanister", "_SnsSwapCanister", "Canister", "params", "ticket", "fromNullable", "buyer_state", "certified", "response", "result", "fromDefinedNullable", "errorType", "SnsSwapGetOpenTicketError", "request", "toNewSaleTicketRequest", "errorData", "SnsSwapNewTicketError", "error", "isMethodNotSupportedError", "UnsupportedMethodError", "options", "service", "certifiedService", "canisterId", "createServices", "idlFactory"]
|
|
7
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as c}from"./chunk-VUTJEPVF.js";import{a as d}from"./chunk-4GE7OJRF.js";import{b as m}from"./chunk-CQAJ2SZB.js";import{d as S}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as c}from"./chunk-VUTJEPVF.js";import{a as d}from"./chunk-4GE7OJRF.js";import{b as m}from"./chunk-CQAJ2SZB.js";import{d as S}from"./chunk-34CD4QJG.js";import{IcrcIndexCanister as u,IcrcLedgerCanister as P}from"@dfinity/ledger-icrc";import{assertNonNullish as r,fromNullable as e}from"@dfinity/utils";var W=async({agent:n,rootOptions:f,certified:t=!0})=>{let s=d.create({...f,agent:n}),{ledger:C,swap:I,governance:l,index:y}=await s.listSnsCanisters({certified:t}),i=e(l),o=e(C),a=e(I),p=e(y);return r(i),r(o),r(a),r(p),new m({root:s,governance:c.create({canisterId:i,agent:n}),ledger:P.create({canisterId:o,agent:n}),swap:S.create({canisterId:a,agent:n}),index:u.create({canisterId:p,agent:n}),certified:t})};export{W as a};
|
|
2
|
+
//# sourceMappingURL=chunk-R7I3KJ5Z.js.map
|
package/dist/esm/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as Ve}from"./chunk-VWOOXKKM.js";import{a as ne,b as ae}from"./chunk-VUTJEPVF.js";import{a as re}from"./chunk-4GE7OJRF.js";import{a as fe,b as Te}from"./chunk-CQAJ2SZB.js";import{a as Lt}from"./chunk-4INNMFYU.js";import{a as ve,b as ye,c as Se,d as ie}from"./chunk-EPQ5JVPZ.js";var _e=(o=>(o[o.NEURON_PERMISSION_TYPE_UNSPECIFIED=0]="NEURON_PERMISSION_TYPE_UNSPECIFIED",o[o.NEURON_PERMISSION_TYPE_CONFIGURE_DISSOLVE_STATE=1]="NEURON_PERMISSION_TYPE_CONFIGURE_DISSOLVE_STATE",o[o.NEURON_PERMISSION_TYPE_MANAGE_PRINCIPALS=2]="NEURON_PERMISSION_TYPE_MANAGE_PRINCIPALS",o[o.NEURON_PERMISSION_TYPE_SUBMIT_PROPOSAL=3]="NEURON_PERMISSION_TYPE_SUBMIT_PROPOSAL",o[o.NEURON_PERMISSION_TYPE_VOTE=4]="NEURON_PERMISSION_TYPE_VOTE",o[o.NEURON_PERMISSION_TYPE_DISBURSE=5]="NEURON_PERMISSION_TYPE_DISBURSE",o[o.NEURON_PERMISSION_TYPE_SPLIT=6]="NEURON_PERMISSION_TYPE_SPLIT",o[o.NEURON_PERMISSION_TYPE_MERGE_MATURITY=7]="NEURON_PERMISSION_TYPE_MERGE_MATURITY",o[o.NEURON_PERMISSION_TYPE_DISBURSE_MATURITY=8]="NEURON_PERMISSION_TYPE_DISBURSE_MATURITY",o[o.NEURON_PERMISSION_TYPE_STAKE_MATURITY=9]="NEURON_PERMISSION_TYPE_STAKE_MATURITY",o[o.NEURON_PERMISSION_TYPE_MANAGE_VOTING_PERMISSION=10]="NEURON_PERMISSION_TYPE_MANAGE_VOTING_PERMISSION",o))(_e||{}),ce=(a=>(a[a.PROPOSAL_REWARD_STATUS_UNSPECIFIED=0]="PROPOSAL_REWARD_STATUS_UNSPECIFIED",a[a.PROPOSAL_REWARD_STATUS_ACCEPT_VOTES=1]="PROPOSAL_REWARD_STATUS_ACCEPT_VOTES",a[a.PROPOSAL_REWARD_STATUS_READY_TO_SETTLE=2]="PROPOSAL_REWARD_STATUS_READY_TO_SETTLE",a[a.PROPOSAL_REWARD_STATUS_SETTLED=3]="PROPOSAL_REWARD_STATUS_SETTLED",a))(ce||{}),pe=(e=>(e[e.PROPOSAL_DECISION_STATUS_UNSPECIFIED=0]="PROPOSAL_DECISION_STATUS_UNSPECIFIED",e[e.PROPOSAL_DECISION_STATUS_OPEN=1]="PROPOSAL_DECISION_STATUS_OPEN",e[e.PROPOSAL_DECISION_STATUS_REJECTED=2]="PROPOSAL_DECISION_STATUS_REJECTED",e[e.PROPOSAL_DECISION_STATUS_ADOPTED=3]="PROPOSAL_DECISION_STATUS_ADOPTED",e[e.PROPOSAL_DECISION_STATUS_EXECUTED=4]="PROPOSAL_DECISION_STATUS_EXECUTED",e[e.PROPOSAL_DECISION_STATUS_FAILED=5]="PROPOSAL_DECISION_STATUS_FAILED",e))(pe||{}),de=(s=>(s[s.Unspecified=0]="Unspecified",s[s.Yes=1]="Yes",s[s.No=2]="No",s))(de||{});var ue=(e=>(e[e.Unspecified=0]="Unspecified",e[e.Pending=1]="Pending",e[e.Open=2]="Open",e[e.Committed=3]="Committed",e[e.Aborted=4]="Aborted",e[e.Adopted=5]="Adopted",e))(ue||{}),le=(s=>(s[s.TYPE_UNSPECIFIED=0]="TYPE_UNSPECIFIED",s[s.TYPE_SALE_NOT_OPEN=1]="TYPE_SALE_NOT_OPEN",s[s.TYPE_SALE_CLOSED=2]="TYPE_SALE_CLOSED",s))(le||{}),me=(n=>(n[n.TYPE_UNSPECIFIED=0]="TYPE_UNSPECIFIED",n[n.TYPE_SALE_NOT_OPEN=1]="TYPE_SALE_NOT_OPEN",n[n.TYPE_SALE_CLOSED=2]="TYPE_SALE_CLOSED",n[n.TYPE_TICKET_EXISTS=3]="TYPE_TICKET_EXISTS",n[n.TYPE_INVALID_USER_AMOUNT=4]="TYPE_INVALID_USER_AMOUNT",n[n.TYPE_INVALID_SUBACCOUNT=5]="TYPE_INVALID_SUBACCOUNT",n[n.TYPE_INVALID_PRINCIPAL=6]="TYPE_INVALID_PRINCIPAL",n))(me||{});import{Canister as Ne,createServices as Oe,fromNullable as Re,isNullish as ge,toNullable as oe}from"@dfinity/utils";var te=({IDL:t})=>{let A=t.Record({validator_canister_id:t.Opt(t.Principal),target_canister_id:t.Opt(t.Principal),validator_method_name:t.Opt(t.Text),target_method_name:t.Opt(t.Text)}),u=t.Variant({NativeNervousSystemFunction:t.Record({}),GenericNervousSystemFunction:A}),s=t.Record({id:t.Nat64,name:t.Text,description:t.Opt(t.Text),function_type:t.Opt(u)}),a=t.Record({not_dissolving_neurons_e8s_buckets:t.Vec(t.Tuple(t.Nat64,t.Float64)),garbage_collectable_neurons_count:t.Nat64,neurons_with_invalid_stake_count:t.Nat64,not_dissolving_neurons_count_buckets:t.Vec(t.Tuple(t.Nat64,t.Nat64)),neurons_with_less_than_6_months_dissolve_delay_count:t.Nat64,dissolved_neurons_count:t.Nat64,total_staked_e8s:t.Nat64,total_supply_governance_tokens:t.Nat64,not_dissolving_neurons_count:t.Nat64,dissolved_neurons_e8s:t.Nat64,neurons_with_less_than_6_months_dissolve_delay_e8s:t.Nat64,dissolving_neurons_count_buckets:t.Vec(t.Tuple(t.Nat64,t.Nat64)),dissolving_neurons_count:t.Nat64,dissolving_neurons_e8s_buckets:t.Vec(t.Tuple(t.Nat64,t.Float64)),timestamp_seconds:t.Nat64}),c=t.Record({current_basis_points:t.Opt(t.Int32),updated_at_timestamp_seconds:t.Opt(t.Nat64)}),e=t.Record({id:t.Vec(t.Nat8)}),n=t.Record({followees:t.Vec(e)}),E=t.Record({followees:t.Vec(t.Tuple(t.Nat64,n))}),p=t.Record({permissions:t.Vec(t.Int32)}),G=t.Record({final_reward_rate_basis_points:t.Opt(t.Nat64),initial_reward_rate_basis_points:t.Opt(t.Nat64),reward_rate_transition_duration_seconds:t.Opt(t.Nat64),round_duration_seconds:t.Opt(t.Nat64)}),o=t.Record({default_followees:t.Opt(E),max_dissolve_delay_seconds:t.Opt(t.Nat64),max_dissolve_delay_bonus_percentage:t.Opt(t.Nat64),max_followees_per_function:t.Opt(t.Nat64),neuron_claimer_permissions:t.Opt(p),neuron_minimum_stake_e8s:t.Opt(t.Nat64),max_neuron_age_for_age_bonus:t.Opt(t.Nat64),initial_voting_period_seconds:t.Opt(t.Nat64),neuron_minimum_dissolve_delay_to_vote_seconds:t.Opt(t.Nat64),reject_cost_e8s:t.Opt(t.Nat64),max_proposals_to_keep_per_action:t.Opt(t.Nat32),wait_for_quiet_deadline_increase_seconds:t.Opt(t.Nat64),max_number_of_neurons:t.Opt(t.Nat64),transaction_fee_e8s:t.Opt(t.Nat64),max_number_of_proposals_with_ballots:t.Opt(t.Nat64),max_age_bonus_percentage:t.Opt(t.Nat64),neuron_grantable_permissions:t.Opt(p),voting_rewards_parameters:t.Opt(G),maturity_modulation_disabled:t.Opt(t.Bool),max_number_of_principals_per_neuron:t.Opt(t.Nat64)}),l=t.Record({archive_wasm_hash:t.Vec(t.Nat8),root_wasm_hash:t.Vec(t.Nat8),swap_wasm_hash:t.Vec(t.Nat8),ledger_wasm_hash:t.Vec(t.Nat8),governance_wasm_hash:t.Vec(t.Nat8),index_wasm_hash:t.Vec(t.Nat8)}),i=t.Record({id:t.Nat64}),R=t.Record({rounds_since_last_distribution:t.Opt(t.Nat64),actual_timestamp_seconds:t.Nat64,end_timestamp_seconds:t.Opt(t.Nat64),total_available_e8s_equivalent:t.Opt(t.Nat64),distributed_e8s_equivalent:t.Nat64,round:t.Nat64,settled_proposals:t.Vec(i)}),g=t.Record({mark_failed_at_seconds:t.Nat64,checking_upgrade_lock:t.Nat64,proposal_id:t.Nat64,target_version:t.Opt(l)}),_=t.Record({error_message:t.Text,error_type:t.Int32}),m=t.Record({subaccount:t.Vec(t.Nat8)}),r=t.Record({owner:t.Opt(t.Principal),subaccount:t.Opt(m)}),v=t.Record({human_readable:t.Opt(t.Text)}),U=t.Record({e8s:t.Opt(t.Nat64)}),q=t.Record({xdrs_per_icp:t.Opt(v),icps_per_token:t.Opt(v),tokens:t.Opt(U)}),B=t.Record({token:t.Opt(t.Int32),account:t.Opt(r),valuation_factors:t.Opt(q),timestamp_seconds:t.Opt(t.Nat64)}),y=t.Record({valuation:t.Opt(B)}),z=t.Variant({TransferSnsTreasuryFunds:y,MintSnsTokens:y}),Y=t.Record({vote:t.Int32,cast_timestamp_seconds:t.Nat64,voting_power:t.Nat64}),S=t.Record({basis_points:t.Opt(t.Nat64)}),W=t.Record({no:t.Nat64,yes:t.Nat64,total:t.Nat64,timestamp_seconds:t.Nat64}),j=t.Record({freezing_threshold:t.Opt(t.Nat64),canister_ids:t.Vec(t.Principal),reserved_cycles_limit:t.Opt(t.Nat64),log_visibility:t.Opt(t.Int32),wasm_memory_limit:t.Opt(t.Nat64),memory_allocation:t.Opt(t.Nat64),compute_allocation:t.Opt(t.Nat64)}),Q=t.Record({canister_ids:t.Vec(t.Principal)}),K=t.Record({from_treasury:t.Int32,to_principal:t.Opt(t.Principal),to_subaccount:t.Opt(m),memo:t.Opt(t.Nat64),amount_e8s:t.Nat64}),X=t.Record({new_canister_wasm:t.Vec(t.Nat8),mode:t.Opt(t.Int32),canister_id:t.Opt(t.Principal),canister_upgrade_arg:t.Opt(t.Vec(t.Nat8))}),J=t.Record({canister_ids:t.Vec(t.Principal),new_controllers:t.Vec(t.Principal)}),H=t.Record({to_principal:t.Opt(t.Principal),to_subaccount:t.Opt(m),memo:t.Opt(t.Nat64),amount_e8s:t.Opt(t.Nat64)}),f=t.Record({url:t.Opt(t.Text),logo:t.Opt(t.Text),name:t.Opt(t.Text),description:t.Opt(t.Text)}),Z=t.Record({function_id:t.Nat64,payload:t.Vec(t.Nat8)}),$=t.Record({token_symbol:t.Opt(t.Text),transfer_fee:t.Opt(t.Nat64),token_logo:t.Opt(t.Text),token_name:t.Opt(t.Text)}),I=t.Record({motion_text:t.Text}),D=t.Variant({ManageNervousSystemParameters:o,AddGenericNervousSystemFunction:s,ManageDappCanisterSettings:j,RemoveGenericNervousSystemFunction:t.Nat64,UpgradeSnsToNextVersion:t.Record({}),RegisterDappCanisters:Q,TransferSnsTreasuryFunds:K,UpgradeSnsControlledCanister:X,DeregisterDappCanisters:J,MintSnsTokens:H,Unspecified:t.Record({}),ManageSnsMetadata:f,ExecuteGenericNervousSystemFunction:Z,ManageLedgerParameters:$,Motion:I}),N=t.Record({url:t.Text,title:t.Text,action:t.Opt(D),summary:t.Text}),L=t.Record({current_deadline_timestamp_seconds:t.Nat64}),O=t.Record({id:t.Opt(i),payload_text_rendering:t.Opt(t.Text),action:t.Nat64,failure_reason:t.Opt(_),action_auxiliary:t.Opt(z),ballots:t.Vec(t.Tuple(t.Text,Y)),minimum_yes_proportion_of_total:t.Opt(S),reward_event_round:t.Nat64,failed_timestamp_seconds:t.Nat64,reward_event_end_timestamp_seconds:t.Opt(t.Nat64),proposal_creation_timestamp_seconds:t.Nat64,initial_voting_period_seconds:t.Nat64,reject_cost_e8s:t.Nat64,latest_tally:t.Opt(W),wait_for_quiet_deadline_increase_seconds:t.Nat64,decided_timestamp_seconds:t.Nat64,proposal:t.Opt(N),proposer:t.Opt(e),wait_for_quiet_state:t.Opt(L),minimum_yes_proportion_of_exercised:t.Opt(S),is_eligible_for_rewards:t.Bool,executed_timestamp_seconds:t.Nat64}),T=t.Record({memo:t.Nat64,amount_e8s:t.Nat64}),V=t.Record({function_id:t.Nat64,followees:t.Vec(e)}),P=t.Record({to_account:t.Opt(r),percentage_to_disburse:t.Nat32}),tt=t.Record({requested_setting_for_auto_stake_maturity:t.Bool}),et=t.Record({additional_dissolve_delay_seconds:t.Nat32}),ot=t.Record({dissolve_timestamp_seconds:t.Nat64}),st=t.Variant({ChangeAutoStakeMaturity:tt,StopDissolving:t.Record({}),StartDissolving:t.Record({}),IncreaseDissolveDelay:et,SetDissolveTimestamp:ot}),b=t.Record({operation:t.Opt(st)}),x=t.Record({vote:t.Int32,proposal:t.Opt(i)}),nt=t.Record({amount_to_be_disbursed_e8s:t.Nat64,to_account:t.Opt(r)}),at=t.Record({controller:t.Opt(t.Principal),memo:t.Nat64}),rt=t.Variant({MemoAndController:at,NeuronId:t.Record({})}),M=t.Record({by:t.Opt(rt)}),w=t.Record({permissions_to_remove:t.Opt(p),principal_id:t.Opt(t.Principal)}),h=t.Record({permissions_to_add:t.Opt(p),principal_id:t.Opt(t.Principal)}),F=t.Record({percentage_to_merge:t.Nat32}),it=t.Record({e8s:t.Nat64}),C=t.Record({to_account:t.Opt(r),amount:t.Opt(it)}),_t=t.Variant({Split:T,Follow:V,DisburseMaturity:P,Configure:b,RegisterVote:x,SyncCommand:t.Record({}),MakeProposal:N,FinalizeDisburseMaturity:nt,ClaimOrRefreshNeuron:M,RemoveNeuronPermissions:w,AddNeuronPermissions:h,MergeMaturity:F,Disburse:C}),ct=t.Record({command:t.Opt(_t),timestamp:t.Nat64}),pt=t.Record({principal:t.Opt(t.Principal),permission_type:t.Vec(t.Int32)}),dt=t.Variant({DissolveDelaySeconds:t.Nat64,WhenDissolvedTimestampSeconds:t.Nat64}),ut=t.Record({timestamp_of_disbursement_seconds:t.Nat64,amount_e8s:t.Nat64,account_to_disburse_to:t.Opt(r),finalize_disbursement_timestamp_seconds:t.Opt(t.Nat64)}),d=t.Record({id:t.Opt(e),staked_maturity_e8s_equivalent:t.Opt(t.Nat64),permissions:t.Vec(pt),maturity_e8s_equivalent:t.Nat64,cached_neuron_stake_e8s:t.Nat64,created_timestamp_seconds:t.Nat64,source_nns_neuron_id:t.Opt(t.Nat64),auto_stake_maturity:t.Opt(t.Bool),aging_since_timestamp_seconds:t.Nat64,dissolve_state:t.Opt(dt),voting_power_percentage_multiplier:t.Nat64,vesting_period_seconds:t.Opt(t.Nat64),disburse_maturity_in_progress:t.Vec(ut),followees:t.Vec(t.Tuple(t.Nat64,n)),neuron_fees_e8s:t.Nat64}),se=t.Record({root_canister_id:t.Opt(t.Principal),id_to_nervous_system_functions:t.Vec(t.Tuple(t.Nat64,s)),metrics:t.Opt(a),maturity_modulation:t.Opt(c),mode:t.Int32,parameters:t.Opt(o),is_finalizing_disburse_maturity:t.Opt(t.Bool),deployed_version:t.Opt(l),sns_initialization_parameters:t.Text,latest_reward_event:t.Opt(R),pending_version:t.Opt(g),swap_canister_id:t.Opt(t.Principal),ledger_canister_id:t.Opt(t.Principal),proposals:t.Vec(t.Tuple(t.Nat64,O)),in_flight_commands:t.Vec(t.Tuple(t.Text,ct)),sns_metadata:t.Opt(f),neurons:t.Vec(t.Tuple(t.Text,d)),genesis_timestamp_seconds:t.Nat64}),lt=t.Record({id:t.Opt(e),amount_e8s:t.Opt(t.Nat64)}),mt=t.Record({new_maturity_e8s:t.Opt(t.Nat64)}),Nt=t.Record({controller:t.Opt(t.Principal),dissolve_delay_seconds:t.Opt(t.Nat64),source_nns_neuron_id:t.Opt(t.Nat64),stake_e8s:t.Opt(t.Nat64),followees:t.Vec(e),hotkey:t.Opt(t.Principal),neuron_id:t.Opt(e)}),Ot=t.Record({neuron_parameters:t.Vec(Nt)}),Rt=t.Record({id:t.Opt(e),status:t.Int32}),gt=t.Record({swap_neurons:t.Vec(Rt)}),vt=t.Variant({Ok:gt,Err:t.Int32}),yt=t.Record({claim_swap_neurons_result:t.Opt(vt)}),St=t.Record({maturity_modulation:t.Opt(c)}),ft=t.Record({url:t.Opt(t.Text),logo:t.Opt(t.Text),name:t.Opt(t.Text),description:t.Opt(t.Text)}),Tt=t.Record({mode:t.Opt(t.Int32)}),Vt=t.Record({neuron_id:t.Opt(e)}),Pt=t.Variant({Error:_,Neuron:d}),bt=t.Record({result:t.Opt(Pt)}),k=t.Record({proposal_id:t.Opt(i)}),xt=t.Variant({Error:_,Proposal:O}),Mt=t.Record({result:t.Opt(xt)}),wt=t.Variant({stopped:t.Null,stopping:t.Null,running:t.Null}),ht=t.Record({freezing_threshold:t.Nat,controllers:t.Vec(t.Principal),memory_allocation:t.Nat,compute_allocation:t.Nat}),Ft=t.Record({status:wt,memory_size:t.Nat,cycles:t.Nat,settings:ht,idle_cycles_burned_per_day:t.Nat,module_hash:t.Opt(t.Vec(t.Nat8))}),Ct=t.Record({deployed_version:t.Opt(l),pending_version:t.Opt(g)}),kt=t.Record({sns_initialization_parameters:t.Text}),At=t.Record({reserved_ids:t.Vec(t.Nat64),functions:t.Vec(s)}),Et=t.Record({of_principal:t.Opt(t.Principal),limit:t.Nat32,start_page_at:t.Opt(e)}),Gt=t.Record({neurons:t.Vec(d)}),Ut=t.Record({include_reward_status:t.Vec(t.Int32),before_proposal:t.Opt(i),limit:t.Nat32,exclude_type:t.Vec(t.Nat64),include_status:t.Vec(t.Int32)}),qt=t.Record({include_ballots_by_caller:t.Opt(t.Bool),proposals:t.Vec(O)}),Bt=t.Record({percentage_to_stake:t.Opt(t.Nat32)}),zt=t.Variant({Split:T,Follow:V,DisburseMaturity:P,ClaimOrRefresh:M,Configure:b,RegisterVote:x,MakeProposal:N,StakeMaturity:Bt,RemoveNeuronPermissions:w,AddNeuronPermissions:h,MergeMaturity:F,Disburse:C}),Yt=t.Record({subaccount:t.Vec(t.Nat8),command:t.Opt(zt)}),Wt=t.Record({created_neuron_id:t.Opt(e)}),jt=t.Record({amount_disbursed_e8s:t.Nat64,amount_deducted_e8s:t.Opt(t.Nat64)}),Qt=t.Record({refreshed_neuron_id:t.Opt(e)}),Kt=t.Record({maturity_e8s:t.Nat64,staked_maturity_e8s:t.Nat64}),Xt=t.Record({merged_maturity_e8s:t.Nat64,new_stake_e8s:t.Nat64}),Jt=t.Record({transfer_block_height:t.Nat64}),Ht=t.Variant({Error:_,Split:Wt,Follow:t.Record({}),DisburseMaturity:jt,ClaimOrRefresh:Qt,Configure:t.Record({}),RegisterVote:t.Record({}),MakeProposal:k,RemoveNeuronPermission:t.Record({}),StakeMaturity:Kt,MergeMaturity:Xt,Disburse:Jt,AddNeuronPermission:t.Record({})}),Zt=t.Record({command:t.Opt(Ht)}),$t=t.Record({recipient:t.Opt(r),amount_e8s:t.Opt(t.Nat64)}),It=t.Record({mode:t.Int32});return t.Service({add_maturity:t.Func([lt],[mt],[]),claim_swap_neurons:t.Func([Ot],[yt],[]),fail_stuck_upgrade_in_progress:t.Func([t.Record({})],[t.Record({})],[]),get_build_metadata:t.Func([],[t.Text],[]),get_latest_reward_event:t.Func([],[R],[]),get_maturity_modulation:t.Func([t.Record({})],[St],[]),get_metadata:t.Func([t.Record({})],[ft],[]),get_mode:t.Func([t.Record({})],[Tt],[]),get_nervous_system_parameters:t.Func([t.Null],[o],[]),get_neuron:t.Func([Vt],[bt],[]),get_proposal:t.Func([k],[Mt],[]),get_root_canister_status:t.Func([t.Null],[Ft],[]),get_running_sns_version:t.Func([t.Record({})],[Ct],[]),get_sns_initialization_parameters:t.Func([t.Record({})],[kt],[]),list_nervous_system_functions:t.Func([],[At],[]),list_neurons:t.Func([Et],[Gt],[]),list_proposals:t.Func([Ut],[qt],[]),manage_neuron:t.Func([Yt],[Zt],[]),mint_tokens:t.Func([$t],[t.Record({})],[]),set_mode:t.Func([It],[t.Record({})],[]),update_neuron:t.Func([d],[t.Opt(_)],[])})};var ee=({IDL:t})=>{let A=t.Record({validator_canister_id:t.Opt(t.Principal),target_canister_id:t.Opt(t.Principal),validator_method_name:t.Opt(t.Text),target_method_name:t.Opt(t.Text)}),u=t.Variant({NativeNervousSystemFunction:t.Record({}),GenericNervousSystemFunction:A}),s=t.Record({id:t.Nat64,name:t.Text,description:t.Opt(t.Text),function_type:t.Opt(u)}),a=t.Record({not_dissolving_neurons_e8s_buckets:t.Vec(t.Tuple(t.Nat64,t.Float64)),garbage_collectable_neurons_count:t.Nat64,neurons_with_invalid_stake_count:t.Nat64,not_dissolving_neurons_count_buckets:t.Vec(t.Tuple(t.Nat64,t.Nat64)),neurons_with_less_than_6_months_dissolve_delay_count:t.Nat64,dissolved_neurons_count:t.Nat64,total_staked_e8s:t.Nat64,total_supply_governance_tokens:t.Nat64,not_dissolving_neurons_count:t.Nat64,dissolved_neurons_e8s:t.Nat64,neurons_with_less_than_6_months_dissolve_delay_e8s:t.Nat64,dissolving_neurons_count_buckets:t.Vec(t.Tuple(t.Nat64,t.Nat64)),dissolving_neurons_count:t.Nat64,dissolving_neurons_e8s_buckets:t.Vec(t.Tuple(t.Nat64,t.Float64)),timestamp_seconds:t.Nat64}),c=t.Record({current_basis_points:t.Opt(t.Int32),updated_at_timestamp_seconds:t.Opt(t.Nat64)}),e=t.Record({id:t.Vec(t.Nat8)}),n=t.Record({followees:t.Vec(e)}),E=t.Record({followees:t.Vec(t.Tuple(t.Nat64,n))}),p=t.Record({permissions:t.Vec(t.Int32)}),G=t.Record({final_reward_rate_basis_points:t.Opt(t.Nat64),initial_reward_rate_basis_points:t.Opt(t.Nat64),reward_rate_transition_duration_seconds:t.Opt(t.Nat64),round_duration_seconds:t.Opt(t.Nat64)}),o=t.Record({default_followees:t.Opt(E),max_dissolve_delay_seconds:t.Opt(t.Nat64),max_dissolve_delay_bonus_percentage:t.Opt(t.Nat64),max_followees_per_function:t.Opt(t.Nat64),neuron_claimer_permissions:t.Opt(p),neuron_minimum_stake_e8s:t.Opt(t.Nat64),max_neuron_age_for_age_bonus:t.Opt(t.Nat64),initial_voting_period_seconds:t.Opt(t.Nat64),neuron_minimum_dissolve_delay_to_vote_seconds:t.Opt(t.Nat64),reject_cost_e8s:t.Opt(t.Nat64),max_proposals_to_keep_per_action:t.Opt(t.Nat32),wait_for_quiet_deadline_increase_seconds:t.Opt(t.Nat64),max_number_of_neurons:t.Opt(t.Nat64),transaction_fee_e8s:t.Opt(t.Nat64),max_number_of_proposals_with_ballots:t.Opt(t.Nat64),max_age_bonus_percentage:t.Opt(t.Nat64),neuron_grantable_permissions:t.Opt(p),voting_rewards_parameters:t.Opt(G),maturity_modulation_disabled:t.Opt(t.Bool),max_number_of_principals_per_neuron:t.Opt(t.Nat64)}),l=t.Record({archive_wasm_hash:t.Vec(t.Nat8),root_wasm_hash:t.Vec(t.Nat8),swap_wasm_hash:t.Vec(t.Nat8),ledger_wasm_hash:t.Vec(t.Nat8),governance_wasm_hash:t.Vec(t.Nat8),index_wasm_hash:t.Vec(t.Nat8)}),i=t.Record({id:t.Nat64}),R=t.Record({rounds_since_last_distribution:t.Opt(t.Nat64),actual_timestamp_seconds:t.Nat64,end_timestamp_seconds:t.Opt(t.Nat64),total_available_e8s_equivalent:t.Opt(t.Nat64),distributed_e8s_equivalent:t.Nat64,round:t.Nat64,settled_proposals:t.Vec(i)}),g=t.Record({mark_failed_at_seconds:t.Nat64,checking_upgrade_lock:t.Nat64,proposal_id:t.Nat64,target_version:t.Opt(l)}),_=t.Record({error_message:t.Text,error_type:t.Int32}),m=t.Record({subaccount:t.Vec(t.Nat8)}),r=t.Record({owner:t.Opt(t.Principal),subaccount:t.Opt(m)}),v=t.Record({human_readable:t.Opt(t.Text)}),U=t.Record({e8s:t.Opt(t.Nat64)}),q=t.Record({xdrs_per_icp:t.Opt(v),icps_per_token:t.Opt(v),tokens:t.Opt(U)}),B=t.Record({token:t.Opt(t.Int32),account:t.Opt(r),valuation_factors:t.Opt(q),timestamp_seconds:t.Opt(t.Nat64)}),y=t.Record({valuation:t.Opt(B)}),z=t.Variant({TransferSnsTreasuryFunds:y,MintSnsTokens:y}),Y=t.Record({vote:t.Int32,cast_timestamp_seconds:t.Nat64,voting_power:t.Nat64}),S=t.Record({basis_points:t.Opt(t.Nat64)}),W=t.Record({no:t.Nat64,yes:t.Nat64,total:t.Nat64,timestamp_seconds:t.Nat64}),j=t.Record({freezing_threshold:t.Opt(t.Nat64),canister_ids:t.Vec(t.Principal),reserved_cycles_limit:t.Opt(t.Nat64),log_visibility:t.Opt(t.Int32),wasm_memory_limit:t.Opt(t.Nat64),memory_allocation:t.Opt(t.Nat64),compute_allocation:t.Opt(t.Nat64)}),Q=t.Record({canister_ids:t.Vec(t.Principal)}),K=t.Record({from_treasury:t.Int32,to_principal:t.Opt(t.Principal),to_subaccount:t.Opt(m),memo:t.Opt(t.Nat64),amount_e8s:t.Nat64}),X=t.Record({new_canister_wasm:t.Vec(t.Nat8),mode:t.Opt(t.Int32),canister_id:t.Opt(t.Principal),canister_upgrade_arg:t.Opt(t.Vec(t.Nat8))}),J=t.Record({canister_ids:t.Vec(t.Principal),new_controllers:t.Vec(t.Principal)}),H=t.Record({to_principal:t.Opt(t.Principal),to_subaccount:t.Opt(m),memo:t.Opt(t.Nat64),amount_e8s:t.Opt(t.Nat64)}),f=t.Record({url:t.Opt(t.Text),logo:t.Opt(t.Text),name:t.Opt(t.Text),description:t.Opt(t.Text)}),Z=t.Record({function_id:t.Nat64,payload:t.Vec(t.Nat8)}),$=t.Record({token_symbol:t.Opt(t.Text),transfer_fee:t.Opt(t.Nat64),token_logo:t.Opt(t.Text),token_name:t.Opt(t.Text)}),I=t.Record({motion_text:t.Text}),D=t.Variant({ManageNervousSystemParameters:o,AddGenericNervousSystemFunction:s,ManageDappCanisterSettings:j,RemoveGenericNervousSystemFunction:t.Nat64,UpgradeSnsToNextVersion:t.Record({}),RegisterDappCanisters:Q,TransferSnsTreasuryFunds:K,UpgradeSnsControlledCanister:X,DeregisterDappCanisters:J,MintSnsTokens:H,Unspecified:t.Record({}),ManageSnsMetadata:f,ExecuteGenericNervousSystemFunction:Z,ManageLedgerParameters:$,Motion:I}),N=t.Record({url:t.Text,title:t.Text,action:t.Opt(D),summary:t.Text}),L=t.Record({current_deadline_timestamp_seconds:t.Nat64}),O=t.Record({id:t.Opt(i),payload_text_rendering:t.Opt(t.Text),action:t.Nat64,failure_reason:t.Opt(_),action_auxiliary:t.Opt(z),ballots:t.Vec(t.Tuple(t.Text,Y)),minimum_yes_proportion_of_total:t.Opt(S),reward_event_round:t.Nat64,failed_timestamp_seconds:t.Nat64,reward_event_end_timestamp_seconds:t.Opt(t.Nat64),proposal_creation_timestamp_seconds:t.Nat64,initial_voting_period_seconds:t.Nat64,reject_cost_e8s:t.Nat64,latest_tally:t.Opt(W),wait_for_quiet_deadline_increase_seconds:t.Nat64,decided_timestamp_seconds:t.Nat64,proposal:t.Opt(N),proposer:t.Opt(e),wait_for_quiet_state:t.Opt(L),minimum_yes_proportion_of_exercised:t.Opt(S),is_eligible_for_rewards:t.Bool,executed_timestamp_seconds:t.Nat64}),T=t.Record({memo:t.Nat64,amount_e8s:t.Nat64}),V=t.Record({function_id:t.Nat64,followees:t.Vec(e)}),P=t.Record({to_account:t.Opt(r),percentage_to_disburse:t.Nat32}),tt=t.Record({requested_setting_for_auto_stake_maturity:t.Bool}),et=t.Record({additional_dissolve_delay_seconds:t.Nat32}),ot=t.Record({dissolve_timestamp_seconds:t.Nat64}),st=t.Variant({ChangeAutoStakeMaturity:tt,StopDissolving:t.Record({}),StartDissolving:t.Record({}),IncreaseDissolveDelay:et,SetDissolveTimestamp:ot}),b=t.Record({operation:t.Opt(st)}),x=t.Record({vote:t.Int32,proposal:t.Opt(i)}),nt=t.Record({amount_to_be_disbursed_e8s:t.Nat64,to_account:t.Opt(r)}),at=t.Record({controller:t.Opt(t.Principal),memo:t.Nat64}),rt=t.Variant({MemoAndController:at,NeuronId:t.Record({})}),M=t.Record({by:t.Opt(rt)}),w=t.Record({permissions_to_remove:t.Opt(p),principal_id:t.Opt(t.Principal)}),h=t.Record({permissions_to_add:t.Opt(p),principal_id:t.Opt(t.Principal)}),F=t.Record({percentage_to_merge:t.Nat32}),it=t.Record({e8s:t.Nat64}),C=t.Record({to_account:t.Opt(r),amount:t.Opt(it)}),_t=t.Variant({Split:T,Follow:V,DisburseMaturity:P,Configure:b,RegisterVote:x,SyncCommand:t.Record({}),MakeProposal:N,FinalizeDisburseMaturity:nt,ClaimOrRefreshNeuron:M,RemoveNeuronPermissions:w,AddNeuronPermissions:h,MergeMaturity:F,Disburse:C}),ct=t.Record({command:t.Opt(_t),timestamp:t.Nat64}),pt=t.Record({principal:t.Opt(t.Principal),permission_type:t.Vec(t.Int32)}),dt=t.Variant({DissolveDelaySeconds:t.Nat64,WhenDissolvedTimestampSeconds:t.Nat64}),ut=t.Record({timestamp_of_disbursement_seconds:t.Nat64,amount_e8s:t.Nat64,account_to_disburse_to:t.Opt(r),finalize_disbursement_timestamp_seconds:t.Opt(t.Nat64)}),d=t.Record({id:t.Opt(e),staked_maturity_e8s_equivalent:t.Opt(t.Nat64),permissions:t.Vec(pt),maturity_e8s_equivalent:t.Nat64,cached_neuron_stake_e8s:t.Nat64,created_timestamp_seconds:t.Nat64,source_nns_neuron_id:t.Opt(t.Nat64),auto_stake_maturity:t.Opt(t.Bool),aging_since_timestamp_seconds:t.Nat64,dissolve_state:t.Opt(dt),voting_power_percentage_multiplier:t.Nat64,vesting_period_seconds:t.Opt(t.Nat64),disburse_maturity_in_progress:t.Vec(ut),followees:t.Vec(t.Tuple(t.Nat64,n)),neuron_fees_e8s:t.Nat64}),se=t.Record({root_canister_id:t.Opt(t.Principal),id_to_nervous_system_functions:t.Vec(t.Tuple(t.Nat64,s)),metrics:t.Opt(a),maturity_modulation:t.Opt(c),mode:t.Int32,parameters:t.Opt(o),is_finalizing_disburse_maturity:t.Opt(t.Bool),deployed_version:t.Opt(l),sns_initialization_parameters:t.Text,latest_reward_event:t.Opt(R),pending_version:t.Opt(g),swap_canister_id:t.Opt(t.Principal),ledger_canister_id:t.Opt(t.Principal),proposals:t.Vec(t.Tuple(t.Nat64,O)),in_flight_commands:t.Vec(t.Tuple(t.Text,ct)),sns_metadata:t.Opt(f),neurons:t.Vec(t.Tuple(t.Text,d)),genesis_timestamp_seconds:t.Nat64}),lt=t.Record({id:t.Opt(e),amount_e8s:t.Opt(t.Nat64)}),mt=t.Record({new_maturity_e8s:t.Opt(t.Nat64)}),Nt=t.Record({controller:t.Opt(t.Principal),dissolve_delay_seconds:t.Opt(t.Nat64),source_nns_neuron_id:t.Opt(t.Nat64),stake_e8s:t.Opt(t.Nat64),followees:t.Vec(e),hotkey:t.Opt(t.Principal),neuron_id:t.Opt(e)}),Ot=t.Record({neuron_parameters:t.Vec(Nt)}),Rt=t.Record({id:t.Opt(e),status:t.Int32}),gt=t.Record({swap_neurons:t.Vec(Rt)}),vt=t.Variant({Ok:gt,Err:t.Int32}),yt=t.Record({claim_swap_neurons_result:t.Opt(vt)}),St=t.Record({maturity_modulation:t.Opt(c)}),ft=t.Record({url:t.Opt(t.Text),logo:t.Opt(t.Text),name:t.Opt(t.Text),description:t.Opt(t.Text)}),Tt=t.Record({mode:t.Opt(t.Int32)}),Vt=t.Record({neuron_id:t.Opt(e)}),Pt=t.Variant({Error:_,Neuron:d}),bt=t.Record({result:t.Opt(Pt)}),k=t.Record({proposal_id:t.Opt(i)}),xt=t.Variant({Error:_,Proposal:O}),Mt=t.Record({result:t.Opt(xt)}),wt=t.Variant({stopped:t.Null,stopping:t.Null,running:t.Null}),ht=t.Record({freezing_threshold:t.Nat,controllers:t.Vec(t.Principal),memory_allocation:t.Nat,compute_allocation:t.Nat}),Ft=t.Record({status:wt,memory_size:t.Nat,cycles:t.Nat,settings:ht,idle_cycles_burned_per_day:t.Nat,module_hash:t.Opt(t.Vec(t.Nat8))}),Ct=t.Record({deployed_version:t.Opt(l),pending_version:t.Opt(g)}),kt=t.Record({sns_initialization_parameters:t.Text}),At=t.Record({reserved_ids:t.Vec(t.Nat64),functions:t.Vec(s)}),Et=t.Record({of_principal:t.Opt(t.Principal),limit:t.Nat32,start_page_at:t.Opt(e)}),Gt=t.Record({neurons:t.Vec(d)}),Ut=t.Record({include_reward_status:t.Vec(t.Int32),before_proposal:t.Opt(i),limit:t.Nat32,exclude_type:t.Vec(t.Nat64),include_status:t.Vec(t.Int32)}),qt=t.Record({include_ballots_by_caller:t.Opt(t.Bool),proposals:t.Vec(O)}),Bt=t.Record({percentage_to_stake:t.Opt(t.Nat32)}),zt=t.Variant({Split:T,Follow:V,DisburseMaturity:P,ClaimOrRefresh:M,Configure:b,RegisterVote:x,MakeProposal:N,StakeMaturity:Bt,RemoveNeuronPermissions:w,AddNeuronPermissions:h,MergeMaturity:F,Disburse:C}),Yt=t.Record({subaccount:t.Vec(t.Nat8),command:t.Opt(zt)}),Wt=t.Record({created_neuron_id:t.Opt(e)}),jt=t.Record({amount_disbursed_e8s:t.Nat64,amount_deducted_e8s:t.Opt(t.Nat64)}),Qt=t.Record({refreshed_neuron_id:t.Opt(e)}),Kt=t.Record({maturity_e8s:t.Nat64,staked_maturity_e8s:t.Nat64}),Xt=t.Record({merged_maturity_e8s:t.Nat64,new_stake_e8s:t.Nat64}),Jt=t.Record({transfer_block_height:t.Nat64}),Ht=t.Variant({Error:_,Split:Wt,Follow:t.Record({}),DisburseMaturity:jt,ClaimOrRefresh:Qt,Configure:t.Record({}),RegisterVote:t.Record({}),MakeProposal:k,RemoveNeuronPermission:t.Record({}),StakeMaturity:Kt,MergeMaturity:Xt,Disburse:Jt,AddNeuronPermission:t.Record({})}),Zt=t.Record({command:t.Opt(Ht)}),$t=t.Record({recipient:t.Opt(r),amount_e8s:t.Opt(t.Nat64)}),It=t.Record({mode:t.Int32});return t.Service({add_maturity:t.Func([lt],[mt],[]),claim_swap_neurons:t.Func([Ot],[yt],[]),fail_stuck_upgrade_in_progress:t.Func([t.Record({})],[t.Record({})],[]),get_build_metadata:t.Func([],[t.Text],["query"]),get_latest_reward_event:t.Func([],[R],["query"]),get_maturity_modulation:t.Func([t.Record({})],[St],[]),get_metadata:t.Func([t.Record({})],[ft],["query"]),get_mode:t.Func([t.Record({})],[Tt],["query"]),get_nervous_system_parameters:t.Func([t.Null],[o],["query"]),get_neuron:t.Func([Vt],[bt],["query"]),get_proposal:t.Func([k],[Mt],["query"]),get_root_canister_status:t.Func([t.Null],[Ft],[]),get_running_sns_version:t.Func([t.Record({})],[Ct],["query"]),get_sns_initialization_parameters:t.Func([t.Record({})],[kt],["query"]),list_nervous_system_functions:t.Func([],[At],["query"]),list_neurons:t.Func([Et],[Gt],["query"]),list_proposals:t.Func([Ut],[qt],["query"]),manage_neuron:t.Func([Yt],[Zt],[]),mint_tokens:t.Func([$t],[t.Record({})],[]),set_mode:t.Func([It],[t.Record({})],[]),update_neuron:t.Func([d],[t.Opt(_)],[])})};var Dt=class t extends Ne{constructor(){super(...arguments);this.addMaturity=async u=>{let{id:s,amountE8s:a}=u,{new_maturity_e8s:c}=await this.caller(u).add_maturity({id:oe(s),amount_e8s:oe(a)}),e=Re(c);if(ge(e)||e<a)throw new Lt("No maturity added")}}static create(u){let{service:s,certifiedService:a,canisterId:c}=Oe({options:u,idlFactory:ee,certifiedIdlFactory:te});return new t(c,s,a)}};export{le as GetOpenTicketErrorType,me as NewSaleTicketResponseErrorType,ae as SnsGovernanceCanister,Lt as SnsGovernanceError,Dt as SnsGovernanceTestCanister,_e as SnsNeuronPermissionType,pe as SnsProposalDecisionStatus,ce as SnsProposalRewardStatus,re as SnsRootCanister,ie as SnsSwapCanister,Se as SnsSwapGetOpenTicketError,ue as SnsSwapLifecycle,ye as SnsSwapNewTicketError,de as SnsVote,Te as SnsWrapper,ve as UnsupportedMethodError,ne as fromCandidAction,Ve as initSnsWrapper,fe as neuronSubaccount};
|
|
1
|
+
import{a as Ve}from"./chunk-R7I3KJ5Z.js";import{a as ne,b as ae}from"./chunk-VUTJEPVF.js";import{a as re}from"./chunk-4GE7OJRF.js";import{a as fe,b as Te}from"./chunk-CQAJ2SZB.js";import{a as Lt}from"./chunk-4INNMFYU.js";import{a as ve,b as ye,c as Se,d as ie}from"./chunk-34CD4QJG.js";var _e=(o=>(o[o.NEURON_PERMISSION_TYPE_UNSPECIFIED=0]="NEURON_PERMISSION_TYPE_UNSPECIFIED",o[o.NEURON_PERMISSION_TYPE_CONFIGURE_DISSOLVE_STATE=1]="NEURON_PERMISSION_TYPE_CONFIGURE_DISSOLVE_STATE",o[o.NEURON_PERMISSION_TYPE_MANAGE_PRINCIPALS=2]="NEURON_PERMISSION_TYPE_MANAGE_PRINCIPALS",o[o.NEURON_PERMISSION_TYPE_SUBMIT_PROPOSAL=3]="NEURON_PERMISSION_TYPE_SUBMIT_PROPOSAL",o[o.NEURON_PERMISSION_TYPE_VOTE=4]="NEURON_PERMISSION_TYPE_VOTE",o[o.NEURON_PERMISSION_TYPE_DISBURSE=5]="NEURON_PERMISSION_TYPE_DISBURSE",o[o.NEURON_PERMISSION_TYPE_SPLIT=6]="NEURON_PERMISSION_TYPE_SPLIT",o[o.NEURON_PERMISSION_TYPE_MERGE_MATURITY=7]="NEURON_PERMISSION_TYPE_MERGE_MATURITY",o[o.NEURON_PERMISSION_TYPE_DISBURSE_MATURITY=8]="NEURON_PERMISSION_TYPE_DISBURSE_MATURITY",o[o.NEURON_PERMISSION_TYPE_STAKE_MATURITY=9]="NEURON_PERMISSION_TYPE_STAKE_MATURITY",o[o.NEURON_PERMISSION_TYPE_MANAGE_VOTING_PERMISSION=10]="NEURON_PERMISSION_TYPE_MANAGE_VOTING_PERMISSION",o))(_e||{}),ce=(a=>(a[a.PROPOSAL_REWARD_STATUS_UNSPECIFIED=0]="PROPOSAL_REWARD_STATUS_UNSPECIFIED",a[a.PROPOSAL_REWARD_STATUS_ACCEPT_VOTES=1]="PROPOSAL_REWARD_STATUS_ACCEPT_VOTES",a[a.PROPOSAL_REWARD_STATUS_READY_TO_SETTLE=2]="PROPOSAL_REWARD_STATUS_READY_TO_SETTLE",a[a.PROPOSAL_REWARD_STATUS_SETTLED=3]="PROPOSAL_REWARD_STATUS_SETTLED",a))(ce||{}),pe=(e=>(e[e.PROPOSAL_DECISION_STATUS_UNSPECIFIED=0]="PROPOSAL_DECISION_STATUS_UNSPECIFIED",e[e.PROPOSAL_DECISION_STATUS_OPEN=1]="PROPOSAL_DECISION_STATUS_OPEN",e[e.PROPOSAL_DECISION_STATUS_REJECTED=2]="PROPOSAL_DECISION_STATUS_REJECTED",e[e.PROPOSAL_DECISION_STATUS_ADOPTED=3]="PROPOSAL_DECISION_STATUS_ADOPTED",e[e.PROPOSAL_DECISION_STATUS_EXECUTED=4]="PROPOSAL_DECISION_STATUS_EXECUTED",e[e.PROPOSAL_DECISION_STATUS_FAILED=5]="PROPOSAL_DECISION_STATUS_FAILED",e))(pe||{}),de=(s=>(s[s.Unspecified=0]="Unspecified",s[s.Yes=1]="Yes",s[s.No=2]="No",s))(de||{});var ue=(e=>(e[e.Unspecified=0]="Unspecified",e[e.Pending=1]="Pending",e[e.Open=2]="Open",e[e.Committed=3]="Committed",e[e.Aborted=4]="Aborted",e[e.Adopted=5]="Adopted",e))(ue||{}),le=(s=>(s[s.TYPE_UNSPECIFIED=0]="TYPE_UNSPECIFIED",s[s.TYPE_SALE_NOT_OPEN=1]="TYPE_SALE_NOT_OPEN",s[s.TYPE_SALE_CLOSED=2]="TYPE_SALE_CLOSED",s))(le||{}),me=(n=>(n[n.TYPE_UNSPECIFIED=0]="TYPE_UNSPECIFIED",n[n.TYPE_SALE_NOT_OPEN=1]="TYPE_SALE_NOT_OPEN",n[n.TYPE_SALE_CLOSED=2]="TYPE_SALE_CLOSED",n[n.TYPE_TICKET_EXISTS=3]="TYPE_TICKET_EXISTS",n[n.TYPE_INVALID_USER_AMOUNT=4]="TYPE_INVALID_USER_AMOUNT",n[n.TYPE_INVALID_SUBACCOUNT=5]="TYPE_INVALID_SUBACCOUNT",n[n.TYPE_INVALID_PRINCIPAL=6]="TYPE_INVALID_PRINCIPAL",n))(me||{});import{Canister as Ne,createServices as Oe,fromNullable as Re,isNullish as ge,toNullable as oe}from"@dfinity/utils";var te=({IDL:t})=>{let A=t.Record({validator_canister_id:t.Opt(t.Principal),target_canister_id:t.Opt(t.Principal),validator_method_name:t.Opt(t.Text),target_method_name:t.Opt(t.Text)}),u=t.Variant({NativeNervousSystemFunction:t.Record({}),GenericNervousSystemFunction:A}),s=t.Record({id:t.Nat64,name:t.Text,description:t.Opt(t.Text),function_type:t.Opt(u)}),a=t.Record({not_dissolving_neurons_e8s_buckets:t.Vec(t.Tuple(t.Nat64,t.Float64)),garbage_collectable_neurons_count:t.Nat64,neurons_with_invalid_stake_count:t.Nat64,not_dissolving_neurons_count_buckets:t.Vec(t.Tuple(t.Nat64,t.Nat64)),neurons_with_less_than_6_months_dissolve_delay_count:t.Nat64,dissolved_neurons_count:t.Nat64,total_staked_e8s:t.Nat64,total_supply_governance_tokens:t.Nat64,not_dissolving_neurons_count:t.Nat64,dissolved_neurons_e8s:t.Nat64,neurons_with_less_than_6_months_dissolve_delay_e8s:t.Nat64,dissolving_neurons_count_buckets:t.Vec(t.Tuple(t.Nat64,t.Nat64)),dissolving_neurons_count:t.Nat64,dissolving_neurons_e8s_buckets:t.Vec(t.Tuple(t.Nat64,t.Float64)),timestamp_seconds:t.Nat64}),c=t.Record({current_basis_points:t.Opt(t.Int32),updated_at_timestamp_seconds:t.Opt(t.Nat64)}),e=t.Record({id:t.Vec(t.Nat8)}),n=t.Record({followees:t.Vec(e)}),E=t.Record({followees:t.Vec(t.Tuple(t.Nat64,n))}),p=t.Record({permissions:t.Vec(t.Int32)}),G=t.Record({final_reward_rate_basis_points:t.Opt(t.Nat64),initial_reward_rate_basis_points:t.Opt(t.Nat64),reward_rate_transition_duration_seconds:t.Opt(t.Nat64),round_duration_seconds:t.Opt(t.Nat64)}),o=t.Record({default_followees:t.Opt(E),max_dissolve_delay_seconds:t.Opt(t.Nat64),max_dissolve_delay_bonus_percentage:t.Opt(t.Nat64),max_followees_per_function:t.Opt(t.Nat64),neuron_claimer_permissions:t.Opt(p),neuron_minimum_stake_e8s:t.Opt(t.Nat64),max_neuron_age_for_age_bonus:t.Opt(t.Nat64),initial_voting_period_seconds:t.Opt(t.Nat64),neuron_minimum_dissolve_delay_to_vote_seconds:t.Opt(t.Nat64),reject_cost_e8s:t.Opt(t.Nat64),max_proposals_to_keep_per_action:t.Opt(t.Nat32),wait_for_quiet_deadline_increase_seconds:t.Opt(t.Nat64),max_number_of_neurons:t.Opt(t.Nat64),transaction_fee_e8s:t.Opt(t.Nat64),max_number_of_proposals_with_ballots:t.Opt(t.Nat64),max_age_bonus_percentage:t.Opt(t.Nat64),neuron_grantable_permissions:t.Opt(p),voting_rewards_parameters:t.Opt(G),maturity_modulation_disabled:t.Opt(t.Bool),max_number_of_principals_per_neuron:t.Opt(t.Nat64)}),l=t.Record({archive_wasm_hash:t.Vec(t.Nat8),root_wasm_hash:t.Vec(t.Nat8),swap_wasm_hash:t.Vec(t.Nat8),ledger_wasm_hash:t.Vec(t.Nat8),governance_wasm_hash:t.Vec(t.Nat8),index_wasm_hash:t.Vec(t.Nat8)}),i=t.Record({id:t.Nat64}),R=t.Record({rounds_since_last_distribution:t.Opt(t.Nat64),actual_timestamp_seconds:t.Nat64,end_timestamp_seconds:t.Opt(t.Nat64),total_available_e8s_equivalent:t.Opt(t.Nat64),distributed_e8s_equivalent:t.Nat64,round:t.Nat64,settled_proposals:t.Vec(i)}),g=t.Record({mark_failed_at_seconds:t.Nat64,checking_upgrade_lock:t.Nat64,proposal_id:t.Nat64,target_version:t.Opt(l)}),_=t.Record({error_message:t.Text,error_type:t.Int32}),m=t.Record({subaccount:t.Vec(t.Nat8)}),r=t.Record({owner:t.Opt(t.Principal),subaccount:t.Opt(m)}),v=t.Record({human_readable:t.Opt(t.Text)}),U=t.Record({e8s:t.Opt(t.Nat64)}),q=t.Record({xdrs_per_icp:t.Opt(v),icps_per_token:t.Opt(v),tokens:t.Opt(U)}),B=t.Record({token:t.Opt(t.Int32),account:t.Opt(r),valuation_factors:t.Opt(q),timestamp_seconds:t.Opt(t.Nat64)}),y=t.Record({valuation:t.Opt(B)}),z=t.Variant({TransferSnsTreasuryFunds:y,MintSnsTokens:y}),Y=t.Record({vote:t.Int32,cast_timestamp_seconds:t.Nat64,voting_power:t.Nat64}),S=t.Record({basis_points:t.Opt(t.Nat64)}),W=t.Record({no:t.Nat64,yes:t.Nat64,total:t.Nat64,timestamp_seconds:t.Nat64}),j=t.Record({freezing_threshold:t.Opt(t.Nat64),canister_ids:t.Vec(t.Principal),reserved_cycles_limit:t.Opt(t.Nat64),log_visibility:t.Opt(t.Int32),wasm_memory_limit:t.Opt(t.Nat64),memory_allocation:t.Opt(t.Nat64),compute_allocation:t.Opt(t.Nat64)}),Q=t.Record({canister_ids:t.Vec(t.Principal)}),K=t.Record({from_treasury:t.Int32,to_principal:t.Opt(t.Principal),to_subaccount:t.Opt(m),memo:t.Opt(t.Nat64),amount_e8s:t.Nat64}),X=t.Record({new_canister_wasm:t.Vec(t.Nat8),mode:t.Opt(t.Int32),canister_id:t.Opt(t.Principal),canister_upgrade_arg:t.Opt(t.Vec(t.Nat8))}),J=t.Record({canister_ids:t.Vec(t.Principal),new_controllers:t.Vec(t.Principal)}),H=t.Record({to_principal:t.Opt(t.Principal),to_subaccount:t.Opt(m),memo:t.Opt(t.Nat64),amount_e8s:t.Opt(t.Nat64)}),f=t.Record({url:t.Opt(t.Text),logo:t.Opt(t.Text),name:t.Opt(t.Text),description:t.Opt(t.Text)}),Z=t.Record({function_id:t.Nat64,payload:t.Vec(t.Nat8)}),$=t.Record({token_symbol:t.Opt(t.Text),transfer_fee:t.Opt(t.Nat64),token_logo:t.Opt(t.Text),token_name:t.Opt(t.Text)}),I=t.Record({motion_text:t.Text}),D=t.Variant({ManageNervousSystemParameters:o,AddGenericNervousSystemFunction:s,ManageDappCanisterSettings:j,RemoveGenericNervousSystemFunction:t.Nat64,UpgradeSnsToNextVersion:t.Record({}),RegisterDappCanisters:Q,TransferSnsTreasuryFunds:K,UpgradeSnsControlledCanister:X,DeregisterDappCanisters:J,MintSnsTokens:H,Unspecified:t.Record({}),ManageSnsMetadata:f,ExecuteGenericNervousSystemFunction:Z,ManageLedgerParameters:$,Motion:I}),N=t.Record({url:t.Text,title:t.Text,action:t.Opt(D),summary:t.Text}),L=t.Record({current_deadline_timestamp_seconds:t.Nat64}),O=t.Record({id:t.Opt(i),payload_text_rendering:t.Opt(t.Text),action:t.Nat64,failure_reason:t.Opt(_),action_auxiliary:t.Opt(z),ballots:t.Vec(t.Tuple(t.Text,Y)),minimum_yes_proportion_of_total:t.Opt(S),reward_event_round:t.Nat64,failed_timestamp_seconds:t.Nat64,reward_event_end_timestamp_seconds:t.Opt(t.Nat64),proposal_creation_timestamp_seconds:t.Nat64,initial_voting_period_seconds:t.Nat64,reject_cost_e8s:t.Nat64,latest_tally:t.Opt(W),wait_for_quiet_deadline_increase_seconds:t.Nat64,decided_timestamp_seconds:t.Nat64,proposal:t.Opt(N),proposer:t.Opt(e),wait_for_quiet_state:t.Opt(L),minimum_yes_proportion_of_exercised:t.Opt(S),is_eligible_for_rewards:t.Bool,executed_timestamp_seconds:t.Nat64}),T=t.Record({memo:t.Nat64,amount_e8s:t.Nat64}),V=t.Record({function_id:t.Nat64,followees:t.Vec(e)}),P=t.Record({to_account:t.Opt(r),percentage_to_disburse:t.Nat32}),tt=t.Record({requested_setting_for_auto_stake_maturity:t.Bool}),et=t.Record({additional_dissolve_delay_seconds:t.Nat32}),ot=t.Record({dissolve_timestamp_seconds:t.Nat64}),st=t.Variant({ChangeAutoStakeMaturity:tt,StopDissolving:t.Record({}),StartDissolving:t.Record({}),IncreaseDissolveDelay:et,SetDissolveTimestamp:ot}),b=t.Record({operation:t.Opt(st)}),x=t.Record({vote:t.Int32,proposal:t.Opt(i)}),nt=t.Record({amount_to_be_disbursed_e8s:t.Nat64,to_account:t.Opt(r)}),at=t.Record({controller:t.Opt(t.Principal),memo:t.Nat64}),rt=t.Variant({MemoAndController:at,NeuronId:t.Record({})}),M=t.Record({by:t.Opt(rt)}),w=t.Record({permissions_to_remove:t.Opt(p),principal_id:t.Opt(t.Principal)}),h=t.Record({permissions_to_add:t.Opt(p),principal_id:t.Opt(t.Principal)}),F=t.Record({percentage_to_merge:t.Nat32}),it=t.Record({e8s:t.Nat64}),C=t.Record({to_account:t.Opt(r),amount:t.Opt(it)}),_t=t.Variant({Split:T,Follow:V,DisburseMaturity:P,Configure:b,RegisterVote:x,SyncCommand:t.Record({}),MakeProposal:N,FinalizeDisburseMaturity:nt,ClaimOrRefreshNeuron:M,RemoveNeuronPermissions:w,AddNeuronPermissions:h,MergeMaturity:F,Disburse:C}),ct=t.Record({command:t.Opt(_t),timestamp:t.Nat64}),pt=t.Record({principal:t.Opt(t.Principal),permission_type:t.Vec(t.Int32)}),dt=t.Variant({DissolveDelaySeconds:t.Nat64,WhenDissolvedTimestampSeconds:t.Nat64}),ut=t.Record({timestamp_of_disbursement_seconds:t.Nat64,amount_e8s:t.Nat64,account_to_disburse_to:t.Opt(r),finalize_disbursement_timestamp_seconds:t.Opt(t.Nat64)}),d=t.Record({id:t.Opt(e),staked_maturity_e8s_equivalent:t.Opt(t.Nat64),permissions:t.Vec(pt),maturity_e8s_equivalent:t.Nat64,cached_neuron_stake_e8s:t.Nat64,created_timestamp_seconds:t.Nat64,source_nns_neuron_id:t.Opt(t.Nat64),auto_stake_maturity:t.Opt(t.Bool),aging_since_timestamp_seconds:t.Nat64,dissolve_state:t.Opt(dt),voting_power_percentage_multiplier:t.Nat64,vesting_period_seconds:t.Opt(t.Nat64),disburse_maturity_in_progress:t.Vec(ut),followees:t.Vec(t.Tuple(t.Nat64,n)),neuron_fees_e8s:t.Nat64}),se=t.Record({root_canister_id:t.Opt(t.Principal),id_to_nervous_system_functions:t.Vec(t.Tuple(t.Nat64,s)),metrics:t.Opt(a),maturity_modulation:t.Opt(c),mode:t.Int32,parameters:t.Opt(o),is_finalizing_disburse_maturity:t.Opt(t.Bool),deployed_version:t.Opt(l),sns_initialization_parameters:t.Text,latest_reward_event:t.Opt(R),pending_version:t.Opt(g),swap_canister_id:t.Opt(t.Principal),ledger_canister_id:t.Opt(t.Principal),proposals:t.Vec(t.Tuple(t.Nat64,O)),in_flight_commands:t.Vec(t.Tuple(t.Text,ct)),sns_metadata:t.Opt(f),neurons:t.Vec(t.Tuple(t.Text,d)),genesis_timestamp_seconds:t.Nat64}),lt=t.Record({id:t.Opt(e),amount_e8s:t.Opt(t.Nat64)}),mt=t.Record({new_maturity_e8s:t.Opt(t.Nat64)}),Nt=t.Record({controller:t.Opt(t.Principal),dissolve_delay_seconds:t.Opt(t.Nat64),source_nns_neuron_id:t.Opt(t.Nat64),stake_e8s:t.Opt(t.Nat64),followees:t.Vec(e),hotkey:t.Opt(t.Principal),neuron_id:t.Opt(e)}),Ot=t.Record({neuron_parameters:t.Vec(Nt)}),Rt=t.Record({id:t.Opt(e),status:t.Int32}),gt=t.Record({swap_neurons:t.Vec(Rt)}),vt=t.Variant({Ok:gt,Err:t.Int32}),yt=t.Record({claim_swap_neurons_result:t.Opt(vt)}),St=t.Record({maturity_modulation:t.Opt(c)}),ft=t.Record({url:t.Opt(t.Text),logo:t.Opt(t.Text),name:t.Opt(t.Text),description:t.Opt(t.Text)}),Tt=t.Record({mode:t.Opt(t.Int32)}),Vt=t.Record({neuron_id:t.Opt(e)}),Pt=t.Variant({Error:_,Neuron:d}),bt=t.Record({result:t.Opt(Pt)}),k=t.Record({proposal_id:t.Opt(i)}),xt=t.Variant({Error:_,Proposal:O}),Mt=t.Record({result:t.Opt(xt)}),wt=t.Variant({stopped:t.Null,stopping:t.Null,running:t.Null}),ht=t.Record({freezing_threshold:t.Nat,controllers:t.Vec(t.Principal),memory_allocation:t.Nat,compute_allocation:t.Nat}),Ft=t.Record({status:wt,memory_size:t.Nat,cycles:t.Nat,settings:ht,idle_cycles_burned_per_day:t.Nat,module_hash:t.Opt(t.Vec(t.Nat8))}),Ct=t.Record({deployed_version:t.Opt(l),pending_version:t.Opt(g)}),kt=t.Record({sns_initialization_parameters:t.Text}),At=t.Record({reserved_ids:t.Vec(t.Nat64),functions:t.Vec(s)}),Et=t.Record({of_principal:t.Opt(t.Principal),limit:t.Nat32,start_page_at:t.Opt(e)}),Gt=t.Record({neurons:t.Vec(d)}),Ut=t.Record({include_reward_status:t.Vec(t.Int32),before_proposal:t.Opt(i),limit:t.Nat32,exclude_type:t.Vec(t.Nat64),include_status:t.Vec(t.Int32)}),qt=t.Record({include_ballots_by_caller:t.Opt(t.Bool),proposals:t.Vec(O)}),Bt=t.Record({percentage_to_stake:t.Opt(t.Nat32)}),zt=t.Variant({Split:T,Follow:V,DisburseMaturity:P,ClaimOrRefresh:M,Configure:b,RegisterVote:x,MakeProposal:N,StakeMaturity:Bt,RemoveNeuronPermissions:w,AddNeuronPermissions:h,MergeMaturity:F,Disburse:C}),Yt=t.Record({subaccount:t.Vec(t.Nat8),command:t.Opt(zt)}),Wt=t.Record({created_neuron_id:t.Opt(e)}),jt=t.Record({amount_disbursed_e8s:t.Nat64,amount_deducted_e8s:t.Opt(t.Nat64)}),Qt=t.Record({refreshed_neuron_id:t.Opt(e)}),Kt=t.Record({maturity_e8s:t.Nat64,staked_maturity_e8s:t.Nat64}),Xt=t.Record({merged_maturity_e8s:t.Nat64,new_stake_e8s:t.Nat64}),Jt=t.Record({transfer_block_height:t.Nat64}),Ht=t.Variant({Error:_,Split:Wt,Follow:t.Record({}),DisburseMaturity:jt,ClaimOrRefresh:Qt,Configure:t.Record({}),RegisterVote:t.Record({}),MakeProposal:k,RemoveNeuronPermission:t.Record({}),StakeMaturity:Kt,MergeMaturity:Xt,Disburse:Jt,AddNeuronPermission:t.Record({})}),Zt=t.Record({command:t.Opt(Ht)}),$t=t.Record({recipient:t.Opt(r),amount_e8s:t.Opt(t.Nat64)}),It=t.Record({mode:t.Int32});return t.Service({add_maturity:t.Func([lt],[mt],[]),claim_swap_neurons:t.Func([Ot],[yt],[]),fail_stuck_upgrade_in_progress:t.Func([t.Record({})],[t.Record({})],[]),get_build_metadata:t.Func([],[t.Text],[]),get_latest_reward_event:t.Func([],[R],[]),get_maturity_modulation:t.Func([t.Record({})],[St],[]),get_metadata:t.Func([t.Record({})],[ft],[]),get_mode:t.Func([t.Record({})],[Tt],[]),get_nervous_system_parameters:t.Func([t.Null],[o],[]),get_neuron:t.Func([Vt],[bt],[]),get_proposal:t.Func([k],[Mt],[]),get_root_canister_status:t.Func([t.Null],[Ft],[]),get_running_sns_version:t.Func([t.Record({})],[Ct],[]),get_sns_initialization_parameters:t.Func([t.Record({})],[kt],[]),list_nervous_system_functions:t.Func([],[At],[]),list_neurons:t.Func([Et],[Gt],[]),list_proposals:t.Func([Ut],[qt],[]),manage_neuron:t.Func([Yt],[Zt],[]),mint_tokens:t.Func([$t],[t.Record({})],[]),set_mode:t.Func([It],[t.Record({})],[]),update_neuron:t.Func([d],[t.Opt(_)],[])})};var ee=({IDL:t})=>{let A=t.Record({validator_canister_id:t.Opt(t.Principal),target_canister_id:t.Opt(t.Principal),validator_method_name:t.Opt(t.Text),target_method_name:t.Opt(t.Text)}),u=t.Variant({NativeNervousSystemFunction:t.Record({}),GenericNervousSystemFunction:A}),s=t.Record({id:t.Nat64,name:t.Text,description:t.Opt(t.Text),function_type:t.Opt(u)}),a=t.Record({not_dissolving_neurons_e8s_buckets:t.Vec(t.Tuple(t.Nat64,t.Float64)),garbage_collectable_neurons_count:t.Nat64,neurons_with_invalid_stake_count:t.Nat64,not_dissolving_neurons_count_buckets:t.Vec(t.Tuple(t.Nat64,t.Nat64)),neurons_with_less_than_6_months_dissolve_delay_count:t.Nat64,dissolved_neurons_count:t.Nat64,total_staked_e8s:t.Nat64,total_supply_governance_tokens:t.Nat64,not_dissolving_neurons_count:t.Nat64,dissolved_neurons_e8s:t.Nat64,neurons_with_less_than_6_months_dissolve_delay_e8s:t.Nat64,dissolving_neurons_count_buckets:t.Vec(t.Tuple(t.Nat64,t.Nat64)),dissolving_neurons_count:t.Nat64,dissolving_neurons_e8s_buckets:t.Vec(t.Tuple(t.Nat64,t.Float64)),timestamp_seconds:t.Nat64}),c=t.Record({current_basis_points:t.Opt(t.Int32),updated_at_timestamp_seconds:t.Opt(t.Nat64)}),e=t.Record({id:t.Vec(t.Nat8)}),n=t.Record({followees:t.Vec(e)}),E=t.Record({followees:t.Vec(t.Tuple(t.Nat64,n))}),p=t.Record({permissions:t.Vec(t.Int32)}),G=t.Record({final_reward_rate_basis_points:t.Opt(t.Nat64),initial_reward_rate_basis_points:t.Opt(t.Nat64),reward_rate_transition_duration_seconds:t.Opt(t.Nat64),round_duration_seconds:t.Opt(t.Nat64)}),o=t.Record({default_followees:t.Opt(E),max_dissolve_delay_seconds:t.Opt(t.Nat64),max_dissolve_delay_bonus_percentage:t.Opt(t.Nat64),max_followees_per_function:t.Opt(t.Nat64),neuron_claimer_permissions:t.Opt(p),neuron_minimum_stake_e8s:t.Opt(t.Nat64),max_neuron_age_for_age_bonus:t.Opt(t.Nat64),initial_voting_period_seconds:t.Opt(t.Nat64),neuron_minimum_dissolve_delay_to_vote_seconds:t.Opt(t.Nat64),reject_cost_e8s:t.Opt(t.Nat64),max_proposals_to_keep_per_action:t.Opt(t.Nat32),wait_for_quiet_deadline_increase_seconds:t.Opt(t.Nat64),max_number_of_neurons:t.Opt(t.Nat64),transaction_fee_e8s:t.Opt(t.Nat64),max_number_of_proposals_with_ballots:t.Opt(t.Nat64),max_age_bonus_percentage:t.Opt(t.Nat64),neuron_grantable_permissions:t.Opt(p),voting_rewards_parameters:t.Opt(G),maturity_modulation_disabled:t.Opt(t.Bool),max_number_of_principals_per_neuron:t.Opt(t.Nat64)}),l=t.Record({archive_wasm_hash:t.Vec(t.Nat8),root_wasm_hash:t.Vec(t.Nat8),swap_wasm_hash:t.Vec(t.Nat8),ledger_wasm_hash:t.Vec(t.Nat8),governance_wasm_hash:t.Vec(t.Nat8),index_wasm_hash:t.Vec(t.Nat8)}),i=t.Record({id:t.Nat64}),R=t.Record({rounds_since_last_distribution:t.Opt(t.Nat64),actual_timestamp_seconds:t.Nat64,end_timestamp_seconds:t.Opt(t.Nat64),total_available_e8s_equivalent:t.Opt(t.Nat64),distributed_e8s_equivalent:t.Nat64,round:t.Nat64,settled_proposals:t.Vec(i)}),g=t.Record({mark_failed_at_seconds:t.Nat64,checking_upgrade_lock:t.Nat64,proposal_id:t.Nat64,target_version:t.Opt(l)}),_=t.Record({error_message:t.Text,error_type:t.Int32}),m=t.Record({subaccount:t.Vec(t.Nat8)}),r=t.Record({owner:t.Opt(t.Principal),subaccount:t.Opt(m)}),v=t.Record({human_readable:t.Opt(t.Text)}),U=t.Record({e8s:t.Opt(t.Nat64)}),q=t.Record({xdrs_per_icp:t.Opt(v),icps_per_token:t.Opt(v),tokens:t.Opt(U)}),B=t.Record({token:t.Opt(t.Int32),account:t.Opt(r),valuation_factors:t.Opt(q),timestamp_seconds:t.Opt(t.Nat64)}),y=t.Record({valuation:t.Opt(B)}),z=t.Variant({TransferSnsTreasuryFunds:y,MintSnsTokens:y}),Y=t.Record({vote:t.Int32,cast_timestamp_seconds:t.Nat64,voting_power:t.Nat64}),S=t.Record({basis_points:t.Opt(t.Nat64)}),W=t.Record({no:t.Nat64,yes:t.Nat64,total:t.Nat64,timestamp_seconds:t.Nat64}),j=t.Record({freezing_threshold:t.Opt(t.Nat64),canister_ids:t.Vec(t.Principal),reserved_cycles_limit:t.Opt(t.Nat64),log_visibility:t.Opt(t.Int32),wasm_memory_limit:t.Opt(t.Nat64),memory_allocation:t.Opt(t.Nat64),compute_allocation:t.Opt(t.Nat64)}),Q=t.Record({canister_ids:t.Vec(t.Principal)}),K=t.Record({from_treasury:t.Int32,to_principal:t.Opt(t.Principal),to_subaccount:t.Opt(m),memo:t.Opt(t.Nat64),amount_e8s:t.Nat64}),X=t.Record({new_canister_wasm:t.Vec(t.Nat8),mode:t.Opt(t.Int32),canister_id:t.Opt(t.Principal),canister_upgrade_arg:t.Opt(t.Vec(t.Nat8))}),J=t.Record({canister_ids:t.Vec(t.Principal),new_controllers:t.Vec(t.Principal)}),H=t.Record({to_principal:t.Opt(t.Principal),to_subaccount:t.Opt(m),memo:t.Opt(t.Nat64),amount_e8s:t.Opt(t.Nat64)}),f=t.Record({url:t.Opt(t.Text),logo:t.Opt(t.Text),name:t.Opt(t.Text),description:t.Opt(t.Text)}),Z=t.Record({function_id:t.Nat64,payload:t.Vec(t.Nat8)}),$=t.Record({token_symbol:t.Opt(t.Text),transfer_fee:t.Opt(t.Nat64),token_logo:t.Opt(t.Text),token_name:t.Opt(t.Text)}),I=t.Record({motion_text:t.Text}),D=t.Variant({ManageNervousSystemParameters:o,AddGenericNervousSystemFunction:s,ManageDappCanisterSettings:j,RemoveGenericNervousSystemFunction:t.Nat64,UpgradeSnsToNextVersion:t.Record({}),RegisterDappCanisters:Q,TransferSnsTreasuryFunds:K,UpgradeSnsControlledCanister:X,DeregisterDappCanisters:J,MintSnsTokens:H,Unspecified:t.Record({}),ManageSnsMetadata:f,ExecuteGenericNervousSystemFunction:Z,ManageLedgerParameters:$,Motion:I}),N=t.Record({url:t.Text,title:t.Text,action:t.Opt(D),summary:t.Text}),L=t.Record({current_deadline_timestamp_seconds:t.Nat64}),O=t.Record({id:t.Opt(i),payload_text_rendering:t.Opt(t.Text),action:t.Nat64,failure_reason:t.Opt(_),action_auxiliary:t.Opt(z),ballots:t.Vec(t.Tuple(t.Text,Y)),minimum_yes_proportion_of_total:t.Opt(S),reward_event_round:t.Nat64,failed_timestamp_seconds:t.Nat64,reward_event_end_timestamp_seconds:t.Opt(t.Nat64),proposal_creation_timestamp_seconds:t.Nat64,initial_voting_period_seconds:t.Nat64,reject_cost_e8s:t.Nat64,latest_tally:t.Opt(W),wait_for_quiet_deadline_increase_seconds:t.Nat64,decided_timestamp_seconds:t.Nat64,proposal:t.Opt(N),proposer:t.Opt(e),wait_for_quiet_state:t.Opt(L),minimum_yes_proportion_of_exercised:t.Opt(S),is_eligible_for_rewards:t.Bool,executed_timestamp_seconds:t.Nat64}),T=t.Record({memo:t.Nat64,amount_e8s:t.Nat64}),V=t.Record({function_id:t.Nat64,followees:t.Vec(e)}),P=t.Record({to_account:t.Opt(r),percentage_to_disburse:t.Nat32}),tt=t.Record({requested_setting_for_auto_stake_maturity:t.Bool}),et=t.Record({additional_dissolve_delay_seconds:t.Nat32}),ot=t.Record({dissolve_timestamp_seconds:t.Nat64}),st=t.Variant({ChangeAutoStakeMaturity:tt,StopDissolving:t.Record({}),StartDissolving:t.Record({}),IncreaseDissolveDelay:et,SetDissolveTimestamp:ot}),b=t.Record({operation:t.Opt(st)}),x=t.Record({vote:t.Int32,proposal:t.Opt(i)}),nt=t.Record({amount_to_be_disbursed_e8s:t.Nat64,to_account:t.Opt(r)}),at=t.Record({controller:t.Opt(t.Principal),memo:t.Nat64}),rt=t.Variant({MemoAndController:at,NeuronId:t.Record({})}),M=t.Record({by:t.Opt(rt)}),w=t.Record({permissions_to_remove:t.Opt(p),principal_id:t.Opt(t.Principal)}),h=t.Record({permissions_to_add:t.Opt(p),principal_id:t.Opt(t.Principal)}),F=t.Record({percentage_to_merge:t.Nat32}),it=t.Record({e8s:t.Nat64}),C=t.Record({to_account:t.Opt(r),amount:t.Opt(it)}),_t=t.Variant({Split:T,Follow:V,DisburseMaturity:P,Configure:b,RegisterVote:x,SyncCommand:t.Record({}),MakeProposal:N,FinalizeDisburseMaturity:nt,ClaimOrRefreshNeuron:M,RemoveNeuronPermissions:w,AddNeuronPermissions:h,MergeMaturity:F,Disburse:C}),ct=t.Record({command:t.Opt(_t),timestamp:t.Nat64}),pt=t.Record({principal:t.Opt(t.Principal),permission_type:t.Vec(t.Int32)}),dt=t.Variant({DissolveDelaySeconds:t.Nat64,WhenDissolvedTimestampSeconds:t.Nat64}),ut=t.Record({timestamp_of_disbursement_seconds:t.Nat64,amount_e8s:t.Nat64,account_to_disburse_to:t.Opt(r),finalize_disbursement_timestamp_seconds:t.Opt(t.Nat64)}),d=t.Record({id:t.Opt(e),staked_maturity_e8s_equivalent:t.Opt(t.Nat64),permissions:t.Vec(pt),maturity_e8s_equivalent:t.Nat64,cached_neuron_stake_e8s:t.Nat64,created_timestamp_seconds:t.Nat64,source_nns_neuron_id:t.Opt(t.Nat64),auto_stake_maturity:t.Opt(t.Bool),aging_since_timestamp_seconds:t.Nat64,dissolve_state:t.Opt(dt),voting_power_percentage_multiplier:t.Nat64,vesting_period_seconds:t.Opt(t.Nat64),disburse_maturity_in_progress:t.Vec(ut),followees:t.Vec(t.Tuple(t.Nat64,n)),neuron_fees_e8s:t.Nat64}),se=t.Record({root_canister_id:t.Opt(t.Principal),id_to_nervous_system_functions:t.Vec(t.Tuple(t.Nat64,s)),metrics:t.Opt(a),maturity_modulation:t.Opt(c),mode:t.Int32,parameters:t.Opt(o),is_finalizing_disburse_maturity:t.Opt(t.Bool),deployed_version:t.Opt(l),sns_initialization_parameters:t.Text,latest_reward_event:t.Opt(R),pending_version:t.Opt(g),swap_canister_id:t.Opt(t.Principal),ledger_canister_id:t.Opt(t.Principal),proposals:t.Vec(t.Tuple(t.Nat64,O)),in_flight_commands:t.Vec(t.Tuple(t.Text,ct)),sns_metadata:t.Opt(f),neurons:t.Vec(t.Tuple(t.Text,d)),genesis_timestamp_seconds:t.Nat64}),lt=t.Record({id:t.Opt(e),amount_e8s:t.Opt(t.Nat64)}),mt=t.Record({new_maturity_e8s:t.Opt(t.Nat64)}),Nt=t.Record({controller:t.Opt(t.Principal),dissolve_delay_seconds:t.Opt(t.Nat64),source_nns_neuron_id:t.Opt(t.Nat64),stake_e8s:t.Opt(t.Nat64),followees:t.Vec(e),hotkey:t.Opt(t.Principal),neuron_id:t.Opt(e)}),Ot=t.Record({neuron_parameters:t.Vec(Nt)}),Rt=t.Record({id:t.Opt(e),status:t.Int32}),gt=t.Record({swap_neurons:t.Vec(Rt)}),vt=t.Variant({Ok:gt,Err:t.Int32}),yt=t.Record({claim_swap_neurons_result:t.Opt(vt)}),St=t.Record({maturity_modulation:t.Opt(c)}),ft=t.Record({url:t.Opt(t.Text),logo:t.Opt(t.Text),name:t.Opt(t.Text),description:t.Opt(t.Text)}),Tt=t.Record({mode:t.Opt(t.Int32)}),Vt=t.Record({neuron_id:t.Opt(e)}),Pt=t.Variant({Error:_,Neuron:d}),bt=t.Record({result:t.Opt(Pt)}),k=t.Record({proposal_id:t.Opt(i)}),xt=t.Variant({Error:_,Proposal:O}),Mt=t.Record({result:t.Opt(xt)}),wt=t.Variant({stopped:t.Null,stopping:t.Null,running:t.Null}),ht=t.Record({freezing_threshold:t.Nat,controllers:t.Vec(t.Principal),memory_allocation:t.Nat,compute_allocation:t.Nat}),Ft=t.Record({status:wt,memory_size:t.Nat,cycles:t.Nat,settings:ht,idle_cycles_burned_per_day:t.Nat,module_hash:t.Opt(t.Vec(t.Nat8))}),Ct=t.Record({deployed_version:t.Opt(l),pending_version:t.Opt(g)}),kt=t.Record({sns_initialization_parameters:t.Text}),At=t.Record({reserved_ids:t.Vec(t.Nat64),functions:t.Vec(s)}),Et=t.Record({of_principal:t.Opt(t.Principal),limit:t.Nat32,start_page_at:t.Opt(e)}),Gt=t.Record({neurons:t.Vec(d)}),Ut=t.Record({include_reward_status:t.Vec(t.Int32),before_proposal:t.Opt(i),limit:t.Nat32,exclude_type:t.Vec(t.Nat64),include_status:t.Vec(t.Int32)}),qt=t.Record({include_ballots_by_caller:t.Opt(t.Bool),proposals:t.Vec(O)}),Bt=t.Record({percentage_to_stake:t.Opt(t.Nat32)}),zt=t.Variant({Split:T,Follow:V,DisburseMaturity:P,ClaimOrRefresh:M,Configure:b,RegisterVote:x,MakeProposal:N,StakeMaturity:Bt,RemoveNeuronPermissions:w,AddNeuronPermissions:h,MergeMaturity:F,Disburse:C}),Yt=t.Record({subaccount:t.Vec(t.Nat8),command:t.Opt(zt)}),Wt=t.Record({created_neuron_id:t.Opt(e)}),jt=t.Record({amount_disbursed_e8s:t.Nat64,amount_deducted_e8s:t.Opt(t.Nat64)}),Qt=t.Record({refreshed_neuron_id:t.Opt(e)}),Kt=t.Record({maturity_e8s:t.Nat64,staked_maturity_e8s:t.Nat64}),Xt=t.Record({merged_maturity_e8s:t.Nat64,new_stake_e8s:t.Nat64}),Jt=t.Record({transfer_block_height:t.Nat64}),Ht=t.Variant({Error:_,Split:Wt,Follow:t.Record({}),DisburseMaturity:jt,ClaimOrRefresh:Qt,Configure:t.Record({}),RegisterVote:t.Record({}),MakeProposal:k,RemoveNeuronPermission:t.Record({}),StakeMaturity:Kt,MergeMaturity:Xt,Disburse:Jt,AddNeuronPermission:t.Record({})}),Zt=t.Record({command:t.Opt(Ht)}),$t=t.Record({recipient:t.Opt(r),amount_e8s:t.Opt(t.Nat64)}),It=t.Record({mode:t.Int32});return t.Service({add_maturity:t.Func([lt],[mt],[]),claim_swap_neurons:t.Func([Ot],[yt],[]),fail_stuck_upgrade_in_progress:t.Func([t.Record({})],[t.Record({})],[]),get_build_metadata:t.Func([],[t.Text],["query"]),get_latest_reward_event:t.Func([],[R],["query"]),get_maturity_modulation:t.Func([t.Record({})],[St],[]),get_metadata:t.Func([t.Record({})],[ft],["query"]),get_mode:t.Func([t.Record({})],[Tt],["query"]),get_nervous_system_parameters:t.Func([t.Null],[o],["query"]),get_neuron:t.Func([Vt],[bt],["query"]),get_proposal:t.Func([k],[Mt],["query"]),get_root_canister_status:t.Func([t.Null],[Ft],[]),get_running_sns_version:t.Func([t.Record({})],[Ct],["query"]),get_sns_initialization_parameters:t.Func([t.Record({})],[kt],["query"]),list_nervous_system_functions:t.Func([],[At],["query"]),list_neurons:t.Func([Et],[Gt],["query"]),list_proposals:t.Func([Ut],[qt],["query"]),manage_neuron:t.Func([Yt],[Zt],[]),mint_tokens:t.Func([$t],[t.Record({})],[]),set_mode:t.Func([It],[t.Record({})],[]),update_neuron:t.Func([d],[t.Opt(_)],[])})};var Dt=class t extends Ne{constructor(){super(...arguments);this.addMaturity=async u=>{let{id:s,amountE8s:a}=u,{new_maturity_e8s:c}=await this.caller(u).add_maturity({id:oe(s),amount_e8s:oe(a)}),e=Re(c);if(ge(e)||e<a)throw new Lt("No maturity added")}}static create(u){let{service:s,certifiedService:a,canisterId:c}=Oe({options:u,idlFactory:ee,certifiedIdlFactory:te});return new t(c,s,a)}};export{le as GetOpenTicketErrorType,me as NewSaleTicketResponseErrorType,ae as SnsGovernanceCanister,Lt as SnsGovernanceError,Dt as SnsGovernanceTestCanister,_e as SnsNeuronPermissionType,pe as SnsProposalDecisionStatus,ce as SnsProposalRewardStatus,re as SnsRootCanister,ie as SnsSwapCanister,Se as SnsSwapGetOpenTicketError,ue as SnsSwapLifecycle,ye as SnsSwapNewTicketError,de as SnsVote,Te as SnsWrapper,ve as UnsupportedMethodError,ne as fromCandidAction,Ve as initSnsWrapper,fe as neuronSubaccount};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/sns.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-R7I3KJ5Z.js";import"./chunk-VUTJEPVF.js";import"./chunk-4GE7OJRF.js";import"./chunk-CQAJ2SZB.js";import"./chunk-4INNMFYU.js";import"./chunk-34CD4QJG.js";export{a as initSnsWrapper};
|
|
2
2
|
//# sourceMappingURL=sns.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d as a}from"./chunk-
|
|
1
|
+
import{d as a}from"./chunk-34CD4QJG.js";export{a as SnsSwapCanister};
|
|
2
2
|
//# sourceMappingURL=swap.canister.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dfinity/sns",
|
|
3
|
-
"version": "3.0
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "A library for interfacing with a Service Nervous System (SNS) project.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/cjs/index.cjs.js",
|
|
@@ -36,11 +36,11 @@
|
|
|
36
36
|
"sns"
|
|
37
37
|
],
|
|
38
38
|
"peerDependencies": {
|
|
39
|
-
"@dfinity/agent": "^1.
|
|
40
|
-
"@dfinity/candid": "^1.
|
|
41
|
-
"@dfinity/ledger-icrc": "^2.
|
|
42
|
-
"@dfinity/principal": "^1.
|
|
43
|
-
"@dfinity/utils": "^2.
|
|
39
|
+
"@dfinity/agent": "^1.4.0",
|
|
40
|
+
"@dfinity/candid": "^1.4.0",
|
|
41
|
+
"@dfinity/ledger-icrc": "^2.4.0",
|
|
42
|
+
"@dfinity/principal": "^1.4.0",
|
|
43
|
+
"@dfinity/utils": "^2.4.0"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@noble/hashes": "^1.3.2"
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Canister as Ct,createServices as Bt,fromDefinedNullable as S,fromNullable as y}from"@dfinity/utils";var ht=({IDL:t})=>{let i=t.Record({dissolve_delay_interval_seconds:t.Nat64,count:t.Nat64}),e=t.Record({slope_numerator:t.Opt(t.Nat64),intercept_icp_e8s:t.Opt(t.Nat64),from_direct_participation_icp_e8s:t.Opt(t.Nat64),slope_denominator:t.Opt(t.Nat64),to_direct_participation_icp_e8s:t.Opt(t.Nat64)}),n=t.Record({serialized_representation:t.Opt(t.Text)}),s=t.Record({coefficient_intervals:t.Vec(e),max_neurons_fund_participation_icp_e8s:t.Opt(t.Nat64),min_direct_participation_threshold_icp_e8s:t.Opt(t.Nat64),ideal_matched_participation_function:t.Opt(n)}),r=t.Record({has_created_neuron_recipes:t.Opt(t.Bool),nns_neuron_id:t.Nat64,amount_icp_e8s:t.Nat64}),a=t.Record({hotkey_principal:t.Text,cf_neurons:t.Vec(r)}),l=t.Record({cf_participants:t.Vec(a)}),g=t.Record({iso_codes:t.Vec(t.Text)}),O=t.Record({nns_proposal_id:t.Opt(t.Nat64),sns_root_canister_id:t.Text,neurons_fund_participation:t.Opt(t.Bool),min_participant_icp_e8s:t.Opt(t.Nat64),neuron_basket_construction_parameters:t.Opt(i),fallback_controller_principal_ids:t.Vec(t.Text),max_icp_e8s:t.Opt(t.Nat64),neuron_minimum_stake_e8s:t.Opt(t.Nat64),confirmation_text:t.Opt(t.Text),swap_start_timestamp_seconds:t.Opt(t.Nat64),swap_due_timestamp_seconds:t.Opt(t.Nat64),min_participants:t.Opt(t.Nat32),sns_token_e8s:t.Opt(t.Nat64),nns_governance_canister_id:t.Text,transaction_fee_e8s:t.Opt(t.Nat64),icp_ledger_canister_id:t.Text,sns_ledger_canister_id:t.Text,neurons_fund_participation_constraints:t.Opt(s),neurons_fund_participants:t.Opt(l),should_auto_finalize:t.Opt(t.Bool),max_participant_icp_e8s:t.Opt(t.Nat64),sns_governance_canister_id:t.Text,min_direct_participation_icp_e8s:t.Opt(t.Nat64),restricted_countries:t.Opt(g),min_icp_e8s:t.Opt(t.Nat64),max_direct_participation_icp_e8s:t.Opt(t.Nat64)}),w=t.Record({source_principal_id:t.Opt(t.Principal)}),h=t.Record({block_height:t.Opt(t.Nat64)}),P=t.Record({description:t.Opt(t.Text),error_type:t.Opt(t.Int32)}),b=t.Variant({Ok:h,Err:P}),F=t.Record({result:t.Opt(b)}),o=t.Record({code:t.Opt(t.Int32),description:t.Text}),v=t.Record({err:t.Opt(o),dapp_canister_id:t.Opt(t.Principal)}),V=t.Record({failed_updates:t.Vec(v)}),C=t.Variant({Ok:V,Err:o}),m=t.Record({possibility:t.Opt(C)}),c=t.Record({failure:t.Nat32,skipped:t.Nat32,invalid:t.Nat32,success:t.Nat32,global_failures:t.Nat32}),B=t.Record({error_message:t.Text,error_type:t.Int32}),z=t.Record({governance_error:t.Opt(B)}),E=t.Variant({Ok:z,Err:o}),q=t.Record({possibility:t.Opt(E)}),G=t.Record({neurons_fund_participation_icp_e8s:t.Opt(t.Nat64),neurons_fund_neurons_count:t.Opt(t.Nat64)}),A=t.Record({message:t.Opt(t.Text)}),U=t.Variant({Ok:G,Err:A}),M=t.Record({possibility:t.Opt(U)}),Q=t.Variant({Ok:t.Record({}),Err:o}),j=t.Record({possibility:t.Opt(Q)}),p=t.Record({set_dapp_controllers_call_result:t.Opt(m),create_sns_neuron_recipes_result:t.Opt(c),settle_community_fund_participation_result:t.Opt(q),error_message:t.Opt(t.Text),settle_neurons_fund_participation_result:t.Opt(M),set_mode_call_result:t.Opt(j),sweep_icp_result:t.Opt(c),claim_neuron_result:t.Opt(c),sweep_sns_result:t.Opt(c)}),H=t.Record({auto_finalize_swap_response:t.Opt(p),has_auto_finalize_been_attempted:t.Opt(t.Bool),is_auto_finalize_enabled:t.Opt(t.Bool)}),J=t.Record({principal_id:t.Opt(t.Principal)}),N=t.Record({transfer_fee_paid_e8s:t.Opt(t.Nat64),transfer_start_timestamp_seconds:t.Nat64,amount_e8s:t.Nat64,amount_transferred_e8s:t.Opt(t.Nat64),transfer_success_timestamp_seconds:t.Nat64}),_=t.Record({icp:t.Opt(N),has_created_neuron_recipes:t.Opt(t.Bool)}),K=t.Record({buyer_state:t.Opt(_)}),W=t.Record({buyers_total:t.Nat64}),X=t.Variant({stopped:t.Null,stopping:t.Null,running:t.Null}),Y=t.Record({freezing_threshold:t.Nat,controllers:t.Vec(t.Principal),memory_allocation:t.Nat,compute_allocation:t.Nat}),Z=t.Record({status:X,memory_size:t.Nat,cycles:t.Nat,settings:Y,idle_cycles_burned_per_day:t.Nat,module_hash:t.Opt(t.Vec(t.Nat8))}),$=t.Record({sns_tokens_per_icp:t.Opt(t.Float64),buyer_total_icp_e8s:t.Opt(t.Nat64),cf_participant_count:t.Opt(t.Nat64),neurons_fund_participation_icp_e8s:t.Opt(t.Nat64),direct_participation_icp_e8s:t.Opt(t.Nat64),direct_participant_count:t.Opt(t.Nat64),cf_neuron_count:t.Opt(t.Nat64)}),I=t.Record({init:t.Opt(O)}),D=t.Record({decentralization_sale_open_timestamp_seconds:t.Opt(t.Nat64),lifecycle:t.Opt(t.Int32),decentralization_swap_termination_timestamp_seconds:t.Opt(t.Nat64)}),L=t.Record({owner:t.Opt(t.Principal),subaccount:t.Opt(t.Vec(t.Nat8))}),R=t.Record({creation_time:t.Nat64,ticket_id:t.Nat64,account:t.Opt(L),amount_icp_e8s:t.Nat64}),d=t.Record({ticket:t.Opt(R)}),tt=t.Record({error_type:t.Opt(t.Int32)}),et=t.Variant({Ok:d,Err:tt}),nt=t.Record({result:t.Opt(et)}),u=t.Record({min_participant_icp_e8s:t.Nat64,neuron_basket_construction_parameters:t.Opt(i),max_icp_e8s:t.Nat64,swap_due_timestamp_seconds:t.Nat64,min_participants:t.Nat32,sns_token_e8s:t.Nat64,sale_delay_seconds:t.Opt(t.Nat64),max_participant_icp_e8s:t.Nat64,min_direct_participation_icp_e8s:t.Opt(t.Nat64),min_icp_e8s:t.Nat64,max_direct_participation_icp_e8s:t.Opt(t.Nat64)}),it=t.Record({params:t.Opt(u)}),st=t.Record({id:t.Vec(t.Nat8)}),rt=t.Record({dissolve_delay_seconds:t.Nat64,memo:t.Nat64,followees:t.Vec(st)}),at=t.Record({hotkey_principal:t.Text,nns_neuron_id:t.Nat64}),ot=t.Record({buyer_principal:t.Text}),ct=t.Variant({CommunityFund:at,Direct:ot}),f=t.Record({sns:t.Opt(N),claimed_status:t.Opt(t.Int32),neuron_attributes:t.Opt(rt),investor:t.Opt(ct)}),pt=t.Record({auto_finalize_swap_response:t.Opt(p),neuron_recipes:t.Vec(f),next_ticket_id:t.Opt(t.Nat64),decentralization_sale_open_timestamp_seconds:t.Opt(t.Nat64),finalize_swap_in_progress:t.Opt(t.Bool),cf_participants:t.Vec(a),init:t.Opt(O),already_tried_to_auto_finalize:t.Opt(t.Bool),neurons_fund_participation_icp_e8s:t.Opt(t.Nat64),purge_old_tickets_last_completion_timestamp_nanoseconds:t.Opt(t.Nat64),direct_participation_icp_e8s:t.Opt(t.Nat64),lifecycle:t.Int32,purge_old_tickets_next_principal:t.Opt(t.Vec(t.Nat8)),decentralization_swap_termination_timestamp_seconds:t.Opt(t.Nat64),buyers:t.Vec(t.Tuple(t.Text,_)),params:t.Opt(u),open_sns_token_swap_proposal_id:t.Opt(t.Nat64)}),_t=t.Record({sns_tokens_per_icp:t.Float32,buyer_total_icp_e8s:t.Nat64,cf_participant_count:t.Opt(t.Nat64),neurons_fund_participation_icp_e8s:t.Opt(t.Nat64),direct_participation_icp_e8s:t.Opt(t.Nat64),direct_participant_count:t.Opt(t.Nat64),cf_neuron_count:t.Opt(t.Nat64)}),dt=t.Record({swap:t.Opt(pt),derived:t.Opt(_t)}),ut=t.Record({offset:t.Opt(t.Nat64),limit:t.Opt(t.Nat32)}),lt=t.Record({offset:t.Opt(t.Nat32),limit:t.Opt(t.Nat32)}),Ot=t.Record({participation:t.Opt(_),participant_id:t.Opt(t.Principal)}),mt=t.Record({participants:t.Vec(Ot)}),Nt=t.Record({offset:t.Opt(t.Nat64),limit:t.Opt(t.Nat32)}),Rt=t.Record({sns_neuron_recipes:t.Vec(f)}),ft=t.Record({subaccount:t.Opt(t.Vec(t.Nat8)),amount_icp_e8s:t.Nat64}),yt=t.Record({min_amount_icp_e8s_included:t.Nat64,max_amount_icp_e8s_included:t.Nat64}),kt=t.Record({invalid_user_amount:t.Opt(yt),existing_ticket:t.Opt(R),error_type:t.Int32}),Tt=t.Variant({Ok:d,Err:kt}),xt=t.Record({result:t.Opt(Tt)}),St=t.Record({cf_participants:t.Vec(a),params:t.Opt(u),open_sns_token_swap_proposal_id:t.Opt(t.Nat64)}),gt=t.Record({confirmation_text:t.Opt(t.Text),buyer:t.Text}),wt=t.Record({icp_accepted_participation_e8s:t.Nat64,icp_ledger_account_balance_e8s:t.Nat64});return t.Service({error_refund_icp:t.Func([w],[F],[]),finalize_swap:t.Func([t.Record({})],[p],[]),get_auto_finalization_status:t.Func([t.Record({})],[H],[]),get_buyer_state:t.Func([J],[K],[]),get_buyers_total:t.Func([t.Record({})],[W],[]),get_canister_status:t.Func([t.Record({})],[Z],[]),get_derived_state:t.Func([t.Record({})],[$],[]),get_init:t.Func([t.Record({})],[I],[]),get_lifecycle:t.Func([t.Record({})],[D],[]),get_open_ticket:t.Func([t.Record({})],[nt],[]),get_sale_parameters:t.Func([t.Record({})],[it],[]),get_state:t.Func([t.Record({})],[dt],[]),list_community_fund_participants:t.Func([ut],[l],[]),list_direct_participants:t.Func([lt],[mt],[]),list_sns_neuron_recipes:t.Func([Nt],[Rt],[]),new_sale_ticket:t.Func([ft],[xt],[]),notify_payment_failure:t.Func([t.Record({})],[d],[]),open:t.Func([St],[t.Record({})],[]),refresh_buyer_tokens:t.Func([gt],[wt],[]),restore_dapp_controllers:t.Func([t.Record({})],[m],[])})};var Pt=({IDL:t})=>{let i=t.Record({dissolve_delay_interval_seconds:t.Nat64,count:t.Nat64}),e=t.Record({slope_numerator:t.Opt(t.Nat64),intercept_icp_e8s:t.Opt(t.Nat64),from_direct_participation_icp_e8s:t.Opt(t.Nat64),slope_denominator:t.Opt(t.Nat64),to_direct_participation_icp_e8s:t.Opt(t.Nat64)}),n=t.Record({serialized_representation:t.Opt(t.Text)}),s=t.Record({coefficient_intervals:t.Vec(e),max_neurons_fund_participation_icp_e8s:t.Opt(t.Nat64),min_direct_participation_threshold_icp_e8s:t.Opt(t.Nat64),ideal_matched_participation_function:t.Opt(n)}),r=t.Record({has_created_neuron_recipes:t.Opt(t.Bool),nns_neuron_id:t.Nat64,amount_icp_e8s:t.Nat64}),a=t.Record({hotkey_principal:t.Text,cf_neurons:t.Vec(r)}),l=t.Record({cf_participants:t.Vec(a)}),g=t.Record({iso_codes:t.Vec(t.Text)}),O=t.Record({nns_proposal_id:t.Opt(t.Nat64),sns_root_canister_id:t.Text,neurons_fund_participation:t.Opt(t.Bool),min_participant_icp_e8s:t.Opt(t.Nat64),neuron_basket_construction_parameters:t.Opt(i),fallback_controller_principal_ids:t.Vec(t.Text),max_icp_e8s:t.Opt(t.Nat64),neuron_minimum_stake_e8s:t.Opt(t.Nat64),confirmation_text:t.Opt(t.Text),swap_start_timestamp_seconds:t.Opt(t.Nat64),swap_due_timestamp_seconds:t.Opt(t.Nat64),min_participants:t.Opt(t.Nat32),sns_token_e8s:t.Opt(t.Nat64),nns_governance_canister_id:t.Text,transaction_fee_e8s:t.Opt(t.Nat64),icp_ledger_canister_id:t.Text,sns_ledger_canister_id:t.Text,neurons_fund_participation_constraints:t.Opt(s),neurons_fund_participants:t.Opt(l),should_auto_finalize:t.Opt(t.Bool),max_participant_icp_e8s:t.Opt(t.Nat64),sns_governance_canister_id:t.Text,min_direct_participation_icp_e8s:t.Opt(t.Nat64),restricted_countries:t.Opt(g),min_icp_e8s:t.Opt(t.Nat64),max_direct_participation_icp_e8s:t.Opt(t.Nat64)}),w=t.Record({source_principal_id:t.Opt(t.Principal)}),h=t.Record({block_height:t.Opt(t.Nat64)}),P=t.Record({description:t.Opt(t.Text),error_type:t.Opt(t.Int32)}),b=t.Variant({Ok:h,Err:P}),F=t.Record({result:t.Opt(b)}),o=t.Record({code:t.Opt(t.Int32),description:t.Text}),v=t.Record({err:t.Opt(o),dapp_canister_id:t.Opt(t.Principal)}),V=t.Record({failed_updates:t.Vec(v)}),C=t.Variant({Ok:V,Err:o}),m=t.Record({possibility:t.Opt(C)}),c=t.Record({failure:t.Nat32,skipped:t.Nat32,invalid:t.Nat32,success:t.Nat32,global_failures:t.Nat32}),B=t.Record({error_message:t.Text,error_type:t.Int32}),z=t.Record({governance_error:t.Opt(B)}),E=t.Variant({Ok:z,Err:o}),q=t.Record({possibility:t.Opt(E)}),G=t.Record({neurons_fund_participation_icp_e8s:t.Opt(t.Nat64),neurons_fund_neurons_count:t.Opt(t.Nat64)}),A=t.Record({message:t.Opt(t.Text)}),U=t.Variant({Ok:G,Err:A}),M=t.Record({possibility:t.Opt(U)}),Q=t.Variant({Ok:t.Record({}),Err:o}),j=t.Record({possibility:t.Opt(Q)}),p=t.Record({set_dapp_controllers_call_result:t.Opt(m),create_sns_neuron_recipes_result:t.Opt(c),settle_community_fund_participation_result:t.Opt(q),error_message:t.Opt(t.Text),settle_neurons_fund_participation_result:t.Opt(M),set_mode_call_result:t.Opt(j),sweep_icp_result:t.Opt(c),claim_neuron_result:t.Opt(c),sweep_sns_result:t.Opt(c)}),H=t.Record({auto_finalize_swap_response:t.Opt(p),has_auto_finalize_been_attempted:t.Opt(t.Bool),is_auto_finalize_enabled:t.Opt(t.Bool)}),J=t.Record({principal_id:t.Opt(t.Principal)}),N=t.Record({transfer_fee_paid_e8s:t.Opt(t.Nat64),transfer_start_timestamp_seconds:t.Nat64,amount_e8s:t.Nat64,amount_transferred_e8s:t.Opt(t.Nat64),transfer_success_timestamp_seconds:t.Nat64}),_=t.Record({icp:t.Opt(N),has_created_neuron_recipes:t.Opt(t.Bool)}),K=t.Record({buyer_state:t.Opt(_)}),W=t.Record({buyers_total:t.Nat64}),X=t.Variant({stopped:t.Null,stopping:t.Null,running:t.Null}),Y=t.Record({freezing_threshold:t.Nat,controllers:t.Vec(t.Principal),memory_allocation:t.Nat,compute_allocation:t.Nat}),Z=t.Record({status:X,memory_size:t.Nat,cycles:t.Nat,settings:Y,idle_cycles_burned_per_day:t.Nat,module_hash:t.Opt(t.Vec(t.Nat8))}),$=t.Record({sns_tokens_per_icp:t.Opt(t.Float64),buyer_total_icp_e8s:t.Opt(t.Nat64),cf_participant_count:t.Opt(t.Nat64),neurons_fund_participation_icp_e8s:t.Opt(t.Nat64),direct_participation_icp_e8s:t.Opt(t.Nat64),direct_participant_count:t.Opt(t.Nat64),cf_neuron_count:t.Opt(t.Nat64)}),I=t.Record({init:t.Opt(O)}),D=t.Record({decentralization_sale_open_timestamp_seconds:t.Opt(t.Nat64),lifecycle:t.Opt(t.Int32),decentralization_swap_termination_timestamp_seconds:t.Opt(t.Nat64)}),L=t.Record({owner:t.Opt(t.Principal),subaccount:t.Opt(t.Vec(t.Nat8))}),R=t.Record({creation_time:t.Nat64,ticket_id:t.Nat64,account:t.Opt(L),amount_icp_e8s:t.Nat64}),d=t.Record({ticket:t.Opt(R)}),tt=t.Record({error_type:t.Opt(t.Int32)}),et=t.Variant({Ok:d,Err:tt}),nt=t.Record({result:t.Opt(et)}),u=t.Record({min_participant_icp_e8s:t.Nat64,neuron_basket_construction_parameters:t.Opt(i),max_icp_e8s:t.Nat64,swap_due_timestamp_seconds:t.Nat64,min_participants:t.Nat32,sns_token_e8s:t.Nat64,sale_delay_seconds:t.Opt(t.Nat64),max_participant_icp_e8s:t.Nat64,min_direct_participation_icp_e8s:t.Opt(t.Nat64),min_icp_e8s:t.Nat64,max_direct_participation_icp_e8s:t.Opt(t.Nat64)}),it=t.Record({params:t.Opt(u)}),st=t.Record({id:t.Vec(t.Nat8)}),rt=t.Record({dissolve_delay_seconds:t.Nat64,memo:t.Nat64,followees:t.Vec(st)}),at=t.Record({hotkey_principal:t.Text,nns_neuron_id:t.Nat64}),ot=t.Record({buyer_principal:t.Text}),ct=t.Variant({CommunityFund:at,Direct:ot}),f=t.Record({sns:t.Opt(N),claimed_status:t.Opt(t.Int32),neuron_attributes:t.Opt(rt),investor:t.Opt(ct)}),pt=t.Record({auto_finalize_swap_response:t.Opt(p),neuron_recipes:t.Vec(f),next_ticket_id:t.Opt(t.Nat64),decentralization_sale_open_timestamp_seconds:t.Opt(t.Nat64),finalize_swap_in_progress:t.Opt(t.Bool),cf_participants:t.Vec(a),init:t.Opt(O),already_tried_to_auto_finalize:t.Opt(t.Bool),neurons_fund_participation_icp_e8s:t.Opt(t.Nat64),purge_old_tickets_last_completion_timestamp_nanoseconds:t.Opt(t.Nat64),direct_participation_icp_e8s:t.Opt(t.Nat64),lifecycle:t.Int32,purge_old_tickets_next_principal:t.Opt(t.Vec(t.Nat8)),decentralization_swap_termination_timestamp_seconds:t.Opt(t.Nat64),buyers:t.Vec(t.Tuple(t.Text,_)),params:t.Opt(u),open_sns_token_swap_proposal_id:t.Opt(t.Nat64)}),_t=t.Record({sns_tokens_per_icp:t.Float32,buyer_total_icp_e8s:t.Nat64,cf_participant_count:t.Opt(t.Nat64),neurons_fund_participation_icp_e8s:t.Opt(t.Nat64),direct_participation_icp_e8s:t.Opt(t.Nat64),direct_participant_count:t.Opt(t.Nat64),cf_neuron_count:t.Opt(t.Nat64)}),dt=t.Record({swap:t.Opt(pt),derived:t.Opt(_t)}),ut=t.Record({offset:t.Opt(t.Nat64),limit:t.Opt(t.Nat32)}),lt=t.Record({offset:t.Opt(t.Nat32),limit:t.Opt(t.Nat32)}),Ot=t.Record({participation:t.Opt(_),participant_id:t.Opt(t.Principal)}),mt=t.Record({participants:t.Vec(Ot)}),Nt=t.Record({offset:t.Opt(t.Nat64),limit:t.Opt(t.Nat32)}),Rt=t.Record({sns_neuron_recipes:t.Vec(f)}),ft=t.Record({subaccount:t.Opt(t.Vec(t.Nat8)),amount_icp_e8s:t.Nat64}),yt=t.Record({min_amount_icp_e8s_included:t.Nat64,max_amount_icp_e8s_included:t.Nat64}),kt=t.Record({invalid_user_amount:t.Opt(yt),existing_ticket:t.Opt(R),error_type:t.Int32}),Tt=t.Variant({Ok:d,Err:kt}),xt=t.Record({result:t.Opt(Tt)}),St=t.Record({cf_participants:t.Vec(a),params:t.Opt(u),open_sns_token_swap_proposal_id:t.Opt(t.Nat64)}),gt=t.Record({confirmation_text:t.Opt(t.Text),buyer:t.Text}),wt=t.Record({icp_accepted_participation_e8s:t.Nat64,icp_ledger_account_balance_e8s:t.Nat64});return t.Service({error_refund_icp:t.Func([w],[F],[]),finalize_swap:t.Func([t.Record({})],[p],[]),get_auto_finalization_status:t.Func([t.Record({})],[H],["query"]),get_buyer_state:t.Func([J],[K],["query"]),get_buyers_total:t.Func([t.Record({})],[W],[]),get_canister_status:t.Func([t.Record({})],[Z],[]),get_derived_state:t.Func([t.Record({})],[$],["query"]),get_init:t.Func([t.Record({})],[I],["query"]),get_lifecycle:t.Func([t.Record({})],[D],["query"]),get_open_ticket:t.Func([t.Record({})],[nt],["query"]),get_sale_parameters:t.Func([t.Record({})],[it],["query"]),get_state:t.Func([t.Record({})],[dt],["query"]),list_community_fund_participants:t.Func([ut],[l],["query"]),list_direct_participants:t.Func([lt],[mt],["query"]),list_sns_neuron_recipes:t.Func([Nt],[Rt],["query"]),new_sale_ticket:t.Func([ft],[xt],[]),notify_payment_failure:t.Func([t.Record({})],[d],[]),open:t.Func([St],[t.Record({})],[]),refresh_buyer_tokens:t.Func([gt],[wt],[]),restore_dapp_controllers:t.Func([t.Record({})],[m],[])})};var bt=({subaccount:t,amount_icp_e8s:i})=>({subaccount:t===void 0?[]:[t],amount_icp_e8s:i});var k=class extends Error{constructor(e){super();this.methodName=e}};var T=class extends Error{constructor({errorType:i,invalidUserAmount:e,existingTicket:n}){super(),this.errorType=i,this.invalidUserAmount=e,this.existingTicket=n}},x=class extends Error{constructor(e){super();this.errorType=e}};import{nonNullish as Vt}from"@dfinity/utils";var Ft=t=>{if(typeof t=="object"&&Vt(t)&&"message"in t){let i=t.message;return i.includes("has no update method")||i.includes("has no query method")}return!1};var vt=class t extends Ct{constructor(){super(...arguments);this.state=e=>this.caller(e).get_state({});this.notifyPaymentFailure=async()=>{let{ticket:e}=await this.caller({certified:!0}).notify_payment_failure({});return y(e)};this.notifyParticipation=async e=>await this.caller({certified:!0}).refresh_buyer_tokens(e);this.getUserCommitment=async e=>{let{buyer_state:n}=await this.caller({certified:e.certified}).get_buyer_state({principal_id:e.principal_id});return y(n)};this.getDerivedState=async({certified:e})=>this.caller({certified:e}).get_derived_state({});this.getSaleParameters=async({certified:e})=>this.caller({certified:e}).get_sale_parameters({});this.getOpenTicket=async e=>{let{result:n}=await this.caller({certified:e.certified}).get_open_ticket({}),s=S(n);if("Ok"in s)return y(s.Ok.ticket);let r=S(s?.Err?.error_type);throw new x(r)};this.newSaleTicket=async e=>{let n=bt(e),{result:s}=await this.caller({certified:!0}).new_sale_ticket(n),r=S(s);if("Ok"in r)return S(r.Ok.ticket);let a=r.Err;throw new T({errorType:a.error_type,invalidUserAmount:y(a.invalid_user_amount??[]),existingTicket:y(a.existing_ticket??[])})};this.getLifecycle=async e=>this.caller(e).get_lifecycle({});this.getFinalizationStatus=async e=>{try{return await this.caller(e).get_auto_finalization_status({})}catch(n){throw Ft(n)?new k("getFinalizationStatus"):n}}}static create(e){let{service:n,certifiedService:s,canisterId:r}=Bt({options:e,idlFactory:Pt,certifiedIdlFactory:ht});return new t(r,n,s)}};export{k as a,T as b,x as c,vt as d};
|
|
2
|
-
//# sourceMappingURL=chunk-EPQ5JVPZ.js.map
|