stawi_finance_sdk 0.5.1
stawi_finance_sdk: ^0.5.1 copied to clipboard
Stawi client SDK: canonical FinancialIntent encoding, intent digests, account derivation, policy hashes, manifest verification, exact money arithmetic and device signing. Pure Dart; no Flutter, no transport.
0.5.1 #
- Breaking fix:
payoffTopUp(payoff, {required credit, required penaltiesOwed, required duesPayable})returns max(0, payoff + penaltiesOwed + duesPayable- credit), from finance
MemberBook.credit,penalties_owedanddues_payable. 0.5.0'spayoffTopUp(payoff, creditAvailable)returned max(0, payoff - credit_available), which understates the top-up whenever the penalties and dues a settle takes first exceed credit (credit_available floors at zero), so the payoff would be refused InsufficientCredit. Held to Gorules.CreditClaims.TopUpby test/vectors/go_payoff_topups.json (make vectors-dart). Released alongside stawi_api 0.5.1.
- credit), from finance
0.5.0 #
payoffTopUp(payoff, creditAvailable): what a member must pay in before a loan payoff succeeds, from financeMemberBook.credit_available(credit less the penalties and the dues a settle takes first; in a share-out room the rest of the cycle's dues). Released alongside stawi_api 0.5.0.
0.4.0 #
- Engine targets:
RoomEngineTargets(financeRoom.engines: the room's RulesEngine and LoanEngine and whether each is callable) andverifyEngineTarget, which refuses an engine call whose target is not the room's own engine for the action (the LoanEngine for loan actions, the RulesEngine otherwise) or whose grant is not active, with the newEngineCallError.notTheRoomsEngine.verifyEngineCallIntenttakes the room's engines as an optionalengines:argument and makes the same check.
0.3.0 #
- Engine calls (StawiAccount.executeEngineCall):
IntentType.engineCall(24);EngineActionandEngineCall, the nine member actions an account may make on the rules engines, decoded and encoded exactly as the account admits them;engineCallHash(the intent's authorization_id); andverifyEngineCallIntent, which checks that settlement's prepared intent binds exactly the engine call it returned (type, mode, payload hash, room, committed value) and returns the call to show before signing. Replays Go-generated vectors (test/vectors/go_engine_calls.json). - Secret ballots:
voteCommitment, GovernanceModule's commitment keccak256(abi.encode(uint8 choice, bytes32 salt, uint256 proposalId, address member)) as Gostawi.Commitmentcomputes it, so a device commits a COMMIT_VOTE without the choice leaving it;newVoteSalt; and thevoteChoiceFor,voteChoiceAgainstandvoteChoiceAbstainconstants. Replays Go-generated vectors (test/vectors/go_vote_commitments.json).
0.2.0 #
- Account genesis:
AccountPolicy(AccountPolicyLib.PolicyParams) withhash/accountPolicyHash,devicePubkeyHash,genesisDeviceDigestanddeployAccountDigest, so a client can rebuild settlement's PrepareDeployAccountgenesis_digestfrom the policy it was shown, its own device key, its identity salt hash and the account address before signing. Replays Go-generated vectors (test/vectors/go_genesis.json). allowlistModeProtocolandallowlistModeExplicitconstants.
0.1.0 #
- First release: FinancialIntent encoding and digest, account derivation, policy hashes, manifest verification, money arithmetic, secp256k1 and P-256 device signing.
DeviceKey.generate,signPreparedCallandaccountWrappedHashfor settlement's PrepareRoomCall / SubmitRoomCall and account calls.