@fepvenancio/stela-sdk 0.2.1 → 0.2.3
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/index.cjs +118 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +118 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/abi/stela.json +115 -5
package/dist/index.cjs
CHANGED
|
@@ -263,13 +263,15 @@ function findTokenByAddress(address) {
|
|
|
263
263
|
|
|
264
264
|
// src/math/shares.ts
|
|
265
265
|
function convertToShares(percentage, totalSupply, currentIssuedPercentage) {
|
|
266
|
-
|
|
266
|
+
const denominator = currentIssuedPercentage === 0n ? 1n : currentIssuedPercentage;
|
|
267
|
+
return percentage * (totalSupply + VIRTUAL_SHARE_OFFSET) / denominator;
|
|
267
268
|
}
|
|
268
269
|
function scaleByPercentage(value, percentage) {
|
|
269
270
|
return value * percentage / MAX_BPS;
|
|
270
271
|
}
|
|
271
272
|
function sharesToPercentage(shares, totalSupply, currentIssuedPercentage) {
|
|
272
|
-
|
|
273
|
+
const effectivePct = currentIssuedPercentage === 0n ? 1n : currentIssuedPercentage;
|
|
274
|
+
return shares * effectivePct / (totalSupply + VIRTUAL_SHARE_OFFSET);
|
|
273
275
|
}
|
|
274
276
|
function calculateFeeShares(shares, feeBps) {
|
|
275
277
|
return shares * feeBps / MAX_BPS;
|
|
@@ -934,6 +936,28 @@ var stela_default = [
|
|
|
934
936
|
],
|
|
935
937
|
state_mutability: "view"
|
|
936
938
|
},
|
|
939
|
+
{
|
|
940
|
+
type: "function",
|
|
941
|
+
name: "get_treasury",
|
|
942
|
+
inputs: [],
|
|
943
|
+
outputs: [
|
|
944
|
+
{
|
|
945
|
+
type: "core::starknet::contract_address::ContractAddress"
|
|
946
|
+
}
|
|
947
|
+
],
|
|
948
|
+
state_mutability: "view"
|
|
949
|
+
},
|
|
950
|
+
{
|
|
951
|
+
type: "function",
|
|
952
|
+
name: "is_paused",
|
|
953
|
+
inputs: [],
|
|
954
|
+
outputs: [
|
|
955
|
+
{
|
|
956
|
+
type: "core::bool"
|
|
957
|
+
}
|
|
958
|
+
],
|
|
959
|
+
state_mutability: "view"
|
|
960
|
+
},
|
|
937
961
|
{
|
|
938
962
|
type: "function",
|
|
939
963
|
name: "set_inscription_fee",
|
|
@@ -993,6 +1017,52 @@ var stela_default = [
|
|
|
993
1017
|
],
|
|
994
1018
|
outputs: [],
|
|
995
1019
|
state_mutability: "external"
|
|
1020
|
+
},
|
|
1021
|
+
{
|
|
1022
|
+
type: "function",
|
|
1023
|
+
name: "set_implementation_hash",
|
|
1024
|
+
inputs: [
|
|
1025
|
+
{
|
|
1026
|
+
name: "implementation_hash",
|
|
1027
|
+
type: "core::felt252"
|
|
1028
|
+
}
|
|
1029
|
+
],
|
|
1030
|
+
outputs: [],
|
|
1031
|
+
state_mutability: "external"
|
|
1032
|
+
},
|
|
1033
|
+
{
|
|
1034
|
+
type: "function",
|
|
1035
|
+
name: "pause",
|
|
1036
|
+
inputs: [],
|
|
1037
|
+
outputs: [],
|
|
1038
|
+
state_mutability: "external"
|
|
1039
|
+
},
|
|
1040
|
+
{
|
|
1041
|
+
type: "function",
|
|
1042
|
+
name: "unpause",
|
|
1043
|
+
inputs: [],
|
|
1044
|
+
outputs: [],
|
|
1045
|
+
state_mutability: "external"
|
|
1046
|
+
},
|
|
1047
|
+
{
|
|
1048
|
+
type: "function",
|
|
1049
|
+
name: "set_locker_allowed_selector",
|
|
1050
|
+
inputs: [
|
|
1051
|
+
{
|
|
1052
|
+
name: "locker",
|
|
1053
|
+
type: "core::starknet::contract_address::ContractAddress"
|
|
1054
|
+
},
|
|
1055
|
+
{
|
|
1056
|
+
name: "selector",
|
|
1057
|
+
type: "core::felt252"
|
|
1058
|
+
},
|
|
1059
|
+
{
|
|
1060
|
+
name: "allowed",
|
|
1061
|
+
type: "core::bool"
|
|
1062
|
+
}
|
|
1063
|
+
],
|
|
1064
|
+
outputs: [],
|
|
1065
|
+
state_mutability: "external"
|
|
996
1066
|
}
|
|
997
1067
|
]
|
|
998
1068
|
},
|
|
@@ -1419,10 +1489,6 @@ var stela_default = [
|
|
|
1419
1489
|
name: "owner",
|
|
1420
1490
|
type: "core::starknet::contract_address::ContractAddress"
|
|
1421
1491
|
},
|
|
1422
|
-
{
|
|
1423
|
-
name: "treasury",
|
|
1424
|
-
type: "core::starknet::contract_address::ContractAddress"
|
|
1425
|
-
},
|
|
1426
1492
|
{
|
|
1427
1493
|
name: "inscriptions_nft",
|
|
1428
1494
|
type: "core::starknet::contract_address::ContractAddress"
|
|
@@ -1630,6 +1696,47 @@ var stela_default = [
|
|
|
1630
1696
|
kind: "enum",
|
|
1631
1697
|
variants: []
|
|
1632
1698
|
},
|
|
1699
|
+
{
|
|
1700
|
+
type: "event",
|
|
1701
|
+
name: "openzeppelin_security::pausable::PausableComponent::Paused",
|
|
1702
|
+
kind: "struct",
|
|
1703
|
+
members: [
|
|
1704
|
+
{
|
|
1705
|
+
name: "account",
|
|
1706
|
+
type: "core::starknet::contract_address::ContractAddress",
|
|
1707
|
+
kind: "data"
|
|
1708
|
+
}
|
|
1709
|
+
]
|
|
1710
|
+
},
|
|
1711
|
+
{
|
|
1712
|
+
type: "event",
|
|
1713
|
+
name: "openzeppelin_security::pausable::PausableComponent::Unpaused",
|
|
1714
|
+
kind: "struct",
|
|
1715
|
+
members: [
|
|
1716
|
+
{
|
|
1717
|
+
name: "account",
|
|
1718
|
+
type: "core::starknet::contract_address::ContractAddress",
|
|
1719
|
+
kind: "data"
|
|
1720
|
+
}
|
|
1721
|
+
]
|
|
1722
|
+
},
|
|
1723
|
+
{
|
|
1724
|
+
type: "event",
|
|
1725
|
+
name: "openzeppelin_security::pausable::PausableComponent::Event",
|
|
1726
|
+
kind: "enum",
|
|
1727
|
+
variants: [
|
|
1728
|
+
{
|
|
1729
|
+
name: "Paused",
|
|
1730
|
+
type: "openzeppelin_security::pausable::PausableComponent::Paused",
|
|
1731
|
+
kind: "nested"
|
|
1732
|
+
},
|
|
1733
|
+
{
|
|
1734
|
+
name: "Unpaused",
|
|
1735
|
+
type: "openzeppelin_security::pausable::PausableComponent::Unpaused",
|
|
1736
|
+
kind: "nested"
|
|
1737
|
+
}
|
|
1738
|
+
]
|
|
1739
|
+
},
|
|
1633
1740
|
{
|
|
1634
1741
|
type: "event",
|
|
1635
1742
|
name: "openzeppelin_utils::cryptography::nonces::NoncesComponent::Event",
|
|
@@ -1820,6 +1927,11 @@ var stela_default = [
|
|
|
1820
1927
|
type: "openzeppelin_security::reentrancyguard::ReentrancyGuardComponent::Event",
|
|
1821
1928
|
kind: "flat"
|
|
1822
1929
|
},
|
|
1930
|
+
{
|
|
1931
|
+
name: "PausableEvent",
|
|
1932
|
+
type: "openzeppelin_security::pausable::PausableComponent::Event",
|
|
1933
|
+
kind: "flat"
|
|
1934
|
+
},
|
|
1823
1935
|
{
|
|
1824
1936
|
name: "NoncesEvent",
|
|
1825
1937
|
type: "openzeppelin_utils::cryptography::nonces::NoncesComponent::Event",
|