mirror of
https://github.com/alexgo-io/alex-sdk-example.git
synced 2026-01-12 22:12:20 +08:00
bump to latest version of Stacks SDK
This commit is contained in:
12
package.json
12
package.json
@@ -10,21 +10,21 @@
|
||||
"simulation": "tsx simulation/index.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@stacks/connect": "^7.2.1",
|
||||
"@stacks/network": "^6.10.0",
|
||||
"@stacks/connect": "^7.9.0",
|
||||
"@stacks/network": "^7.0.2",
|
||||
"@stacks/stacks-blockchain-api-types": "^7.14.1",
|
||||
"@stacks/transactions": "^6.16.1",
|
||||
"alex-sdk": "^2.1.4",
|
||||
"@stacks/transactions": "^7.0.2",
|
||||
"alex-sdk": "^3.0.0-beta.1",
|
||||
"c32check": "^2.0.0",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"ts-clarity": "^0.0.26"
|
||||
"react-dom": "^18.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/react": "^18.0.27",
|
||||
"@types/react-dom": "^18.0.10",
|
||||
"@vitejs/plugin-react": "^4.3.1",
|
||||
"prettier": "^3.3.2",
|
||||
"stxer": "^0.2.4",
|
||||
"tsx": "^4.19.1",
|
||||
"typescript": "^5.4.5",
|
||||
"vite": "^5.3.1"
|
||||
|
||||
255
pnpm-lock.yaml
generated
255
pnpm-lock.yaml
generated
@@ -9,20 +9,20 @@ importers:
|
||||
.:
|
||||
dependencies:
|
||||
'@stacks/connect':
|
||||
specifier: ^7.2.1
|
||||
version: 7.2.1
|
||||
specifier: ^7.9.0
|
||||
version: 7.9.0
|
||||
'@stacks/network':
|
||||
specifier: ^6.10.0
|
||||
version: 6.10.0
|
||||
specifier: ^7.0.2
|
||||
version: 7.0.2
|
||||
'@stacks/stacks-blockchain-api-types':
|
||||
specifier: ^7.14.1
|
||||
version: 7.14.1
|
||||
'@stacks/transactions':
|
||||
specifier: ^6.16.1
|
||||
version: 6.16.1
|
||||
specifier: ^7.0.2
|
||||
version: 7.0.2
|
||||
alex-sdk:
|
||||
specifier: ^2.1.4
|
||||
version: 2.1.4(@stacks/network@6.10.0)(@stacks/transactions@6.16.1)
|
||||
specifier: ^3.0.0-beta.1
|
||||
version: 3.0.0-beta.1(@stacks/common@7.0.2)(@stacks/network@7.0.2)(@stacks/transactions@7.0.2)
|
||||
c32check:
|
||||
specifier: ^2.0.0
|
||||
version: 2.0.0
|
||||
@@ -32,9 +32,6 @@ importers:
|
||||
react-dom:
|
||||
specifier: ^18.2.0
|
||||
version: 18.2.0(react@18.2.0)
|
||||
ts-clarity:
|
||||
specifier: ^0.0.26
|
||||
version: 0.0.26(typescript@5.4.5)
|
||||
devDependencies:
|
||||
'@types/react':
|
||||
specifier: ^18.0.27
|
||||
@@ -48,6 +45,9 @@ importers:
|
||||
prettier:
|
||||
specifier: ^3.3.2
|
||||
version: 3.3.2
|
||||
stxer:
|
||||
specifier: ^0.2.4
|
||||
version: 0.2.4(typescript@5.4.5)
|
||||
tsx:
|
||||
specifier: ^4.19.1
|
||||
version: 4.19.1
|
||||
@@ -591,35 +591,32 @@ packages:
|
||||
'@scure/bip39@1.1.0':
|
||||
resolution: {integrity: sha512-pwrPOS16VeTKg98dYXQyIjJEcWfz7/1YJIwxUEPFfQPtc86Ym/1sVgQ2RLoD43AazMk2l/unK4ITySSpW2+82w==}
|
||||
|
||||
'@stacks/auth@6.9.0':
|
||||
resolution: {integrity: sha512-tBOB+H/96TUNK9pKmr1YQoiIItUFp2ms5RCNYPSjy3/lbIYYJYtw/O2fOS78fVQvCCpuObhhO65AVsrE/IzQeg==}
|
||||
|
||||
'@stacks/common@6.10.0':
|
||||
resolution: {integrity: sha512-6x5Z7AKd9/kj3+DYE9xIDIkFLHihBH614i2wqrZIjN02WxVo063hWSjIlUxlx8P4gl6olVzlOy5LzhLJD9OP0A==}
|
||||
'@stacks/auth@7.0.2':
|
||||
resolution: {integrity: sha512-1N0ylkK9mz6RqIH3SbuIvoUG4eTgSkun7hHiPirScGCyXvmugjereGdTowSRSrEnl32/qrnquAAaO7a1XF6TMA==}
|
||||
|
||||
'@stacks/common@6.16.0':
|
||||
resolution: {integrity: sha512-PnzvhrdGRMVZvxTulitlYafSK4l02gPCBBoI9QEoTqgSnv62oaOXhYAUUkTMFKxdHW1seVEwZsrahuXiZPIAwg==}
|
||||
|
||||
'@stacks/common@6.8.1':
|
||||
resolution: {integrity: sha512-ewL9GLZNQYa5a/3K4xSHlHIgHkD4rwWW/QEaPId8zQIaL+1O9qCaF4LX9orNQeOmEk8kvG0x2xGV54fXKCZeWQ==}
|
||||
'@stacks/common@7.0.2':
|
||||
resolution: {integrity: sha512-+RSecHdkxOtswmE4tDDoZlYEuULpnTQVeDIG5eZ32opK8cFxf4EugAcK9CsIsHx/Se1yTEaQ21WGATmJGK84lQ==}
|
||||
|
||||
'@stacks/connect-ui@6.0.1':
|
||||
resolution: {integrity: sha512-DOB2UdwLJAznHfsOmloTzK7JDIfxwUq+GqEH6z0snxA3Gsu2aernlLhwUW1QLFXQtPw/fUp1ty+re71qHUc6tg==}
|
||||
'@stacks/connect-ui@6.5.0':
|
||||
resolution: {integrity: sha512-iXSpl2NxrjERBqtGgkZp0tX1uJgdWZXmsNo3I0cJYYTTbieSAE/Al9nTYc1wLTPW5w5oVvZEkQKo90WIrHR8Rw==}
|
||||
|
||||
'@stacks/connect@7.2.1':
|
||||
resolution: {integrity: sha512-AWFvyVWH4z9pbPA+iFoFpVCABcGjJ8ZsqZNroNQOyAq6DVSM+GBSMnNXqnugUnKUE9+IYM7TNKfvKkzN1temiQ==}
|
||||
'@stacks/connect@7.9.0':
|
||||
resolution: {integrity: sha512-UPv2UQpZwnNPYodL4bf+6Pu3kHY9BcRabAgAbmDajn3RFWvDrnOMmvLqJRGOvo5fEm8vSwxAGY8R7BSOPmlLdg==}
|
||||
|
||||
'@stacks/encryption@6.9.0':
|
||||
resolution: {integrity: sha512-hbpZ47eYgw9ZH5ly+GSgvw2Ffsu9L6d++2XIhvYSzL7yxYl4m1+FV5QYdJthJ2AS3vi8cI5otE254HTfCrhKzg==}
|
||||
|
||||
'@stacks/network@6.10.0':
|
||||
resolution: {integrity: sha512-mbiZ8nlsyy77ndmBdaqhHXii22IFdK4ThRcOQs9j/O00DkAr04jCM4GV5Q+VLUnZ9OBoJq7yOV7Pf6jglh+0hw==}
|
||||
'@stacks/encryption@7.0.2':
|
||||
resolution: {integrity: sha512-3evRvxPqVzQAhcZ8uacQrVfAETUMIV8VyKkHGsd4QZroGWlvXQheLV3CFeDttFb304QcKq/oKv1clOvQ2shaAw==}
|
||||
|
||||
'@stacks/network@6.16.0':
|
||||
resolution: {integrity: sha512-uqz9Nb6uf+SeyCKENJN+idt51HAfEeggQKrOMfGjpAeFgZV2CR66soB/ci9+OVQR/SURvasncAz2ScI1blfS8A==}
|
||||
|
||||
'@stacks/profile@6.9.0':
|
||||
resolution: {integrity: sha512-sIR60DsAHi8C6zGqKqSe1r2hXTMHgwrJkX3fAaP3de40KeplZ2bkE+0B83yismEeU2baNc+AukyVvWJv0PfP0A==}
|
||||
'@stacks/network@7.0.2':
|
||||
resolution: {integrity: sha512-XzHnoWqku/jRrTgMXhmh3c+I0O9vDH24KlhzGDZtBu+8CGGyHNPAZzGwvoUShonMXrXjEnfO9IYQwV5aJhfv6g==}
|
||||
|
||||
'@stacks/profile@7.0.2':
|
||||
resolution: {integrity: sha512-BJis1ZAP2yzv0IFaJcm4mZFtauizcB1zBVpAeOSX06BDEUgM8h0L8uRvAbfTvSuSjsveNgblucZouZMSEsQMGA==}
|
||||
|
||||
'@stacks/stacks-blockchain-api-types@7.14.1':
|
||||
resolution: {integrity: sha512-65hvhXxC+EUqHJAQsqlBCqXB+zwfxZICSKYJugdg6BCp9I9qniyfz5XyQeC4RMVo0tgEoRdS/b5ZCFo5kLWmxA==}
|
||||
@@ -627,6 +624,9 @@ packages:
|
||||
'@stacks/transactions@6.16.1':
|
||||
resolution: {integrity: sha512-yCtUM+8IN0QJbnnlFhY1wBW7Q30Cxje3Zmy8DgqdBoM/EPPWadez/8wNWFANVAMyUZeQ9V/FY+8MAw4E+pCReA==}
|
||||
|
||||
'@stacks/transactions@7.0.2':
|
||||
resolution: {integrity: sha512-m2bvchqUeYv1ttXuC0EukW8UX4xBXTDcYb8bXmfI1RG89HXAvvCCgr5aiadU6zbutgoXvm8mquDt3nww0PO4Jg==}
|
||||
|
||||
'@stencil/core@2.22.3':
|
||||
resolution: {integrity: sha512-kmVA0M/HojwsfkeHsifvHVIYe4l5tin7J5+DLgtl8h6WWfiMClND5K3ifCXXI2ETDNKiEk21p6jql3Fx9o2rng==}
|
||||
engines: {node: '>=12.10.0', npm: '>=6.0.0'}
|
||||
@@ -671,12 +671,12 @@ packages:
|
||||
peerDependencies:
|
||||
vite: ^4.2.0 || ^5.0.0
|
||||
|
||||
alex-sdk@2.1.4:
|
||||
resolution: {integrity: sha512-fFFyk3iwioqRsNOiWQyVXl+5vjlIU0ez3Ko9JnE6JBt8F8pNLMAkPIBlZA/nW/EhdFrrTuyuT0CHxH22GumQ5w==}
|
||||
alex-sdk@3.0.0-beta.1:
|
||||
resolution: {integrity: sha512-iKtMU9ALoireV2vruVyiwp/lGwOLZAj4ePtxXouRsuEmipFbKPO1YUZqYui0biqH2T7BihzulMJnLCEZ9cTltg==}
|
||||
engines: {node: '>=10'}
|
||||
peerDependencies:
|
||||
'@stacks/network': ^6.3.0
|
||||
'@stacks/transactions': ^6.2.0
|
||||
'@stacks/network': ^7.0.2
|
||||
'@stacks/transactions': ^7.0.2
|
||||
|
||||
ansi-regex@5.0.1:
|
||||
resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==}
|
||||
@@ -717,9 +717,6 @@ packages:
|
||||
resolution: {integrity: sha512-rpwfAcS/CMqo0oCqDf3r9eeLgScRE3l/xHDCXhM3UyrfvIn7PrLq63uHh7yYbv8NzaZn5MVsVhIRpQ+5GZ5HyA==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
call-bind@1.0.2:
|
||||
resolution: {integrity: sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==}
|
||||
|
||||
caniuse-lite@1.0.30001634:
|
||||
resolution: {integrity: sha512-fbBYXQ9q3+yp1q1gBk86tOFs4pyn/yxFm5ZNP18OXJDfA3txImOY9PhfxVggZ4vRHDqoU8NrKU81eN0OtzOgRA==}
|
||||
|
||||
@@ -735,11 +732,12 @@ packages:
|
||||
typescript:
|
||||
optional: true
|
||||
|
||||
clarity-codegen@0.5.2:
|
||||
resolution: {integrity: sha512-t0uvboeZTII7n2lgobAxcQnhyjXwbUKYdUKJA3yjoaOXPvtr5i2zFV7H1E6ZeDMfqd3vIksMPvpdFfXum9SoNQ==}
|
||||
clarity-codegen@1.0.0-beta.1:
|
||||
resolution: {integrity: sha512-cEyEpOoR3xnTMmGWxycWFH0+Xgmuyhw3ueydg5TFeap1ZXh4/aoxqYIg7JwALlv09wZv/JXe3H+yodMra31pDQ==}
|
||||
hasBin: true
|
||||
peerDependencies:
|
||||
'@stacks/transactions': '*'
|
||||
'@stacks/common': ^7.0.2
|
||||
'@stacks/transactions': ^7.0.2
|
||||
|
||||
cliui@8.0.1:
|
||||
resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==}
|
||||
@@ -829,9 +827,6 @@ packages:
|
||||
engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0}
|
||||
os: [darwin]
|
||||
|
||||
function-bind@1.1.1:
|
||||
resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==}
|
||||
|
||||
gensync@1.0.0-beta.2:
|
||||
resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==}
|
||||
engines: {node: '>=6.9.0'}
|
||||
@@ -840,9 +835,6 @@ packages:
|
||||
resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==}
|
||||
engines: {node: 6.* || 8.* || >= 10.*}
|
||||
|
||||
get-intrinsic@1.2.1:
|
||||
resolution: {integrity: sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==}
|
||||
|
||||
get-tsconfig@4.8.1:
|
||||
resolution: {integrity: sha512-k9PN+cFBmaLWtVz29SkUoqU5O0slLuHJXt/2P+tMVFT+phsSGXGkp9t3rQIqdz0e+06EHNGs3oM6ZX1s2zHxRg==}
|
||||
|
||||
@@ -854,18 +846,6 @@ packages:
|
||||
resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==}
|
||||
engines: {node: '>=4'}
|
||||
|
||||
has-proto@1.0.1:
|
||||
resolution: {integrity: sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==}
|
||||
engines: {node: '>= 0.4'}
|
||||
|
||||
has-symbols@1.0.3:
|
||||
resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==}
|
||||
engines: {node: '>= 0.4'}
|
||||
|
||||
has@1.0.4:
|
||||
resolution: {integrity: sha512-qdSAmqLF6209RFj4VVItywPMbm3vWylknmB3nvNiUIs72xAimcM8nVYxYr7ncvZq5qzk9MKIZR8ijqD/1QuYjQ==}
|
||||
engines: {node: '>= 0.4.0'}
|
||||
|
||||
is-fullwidth-code-point@3.0.0:
|
||||
resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==}
|
||||
engines: {node: '>=8'}
|
||||
@@ -927,9 +907,6 @@ packages:
|
||||
node-releases@2.0.14:
|
||||
resolution: {integrity: sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==}
|
||||
|
||||
object-inspect@1.12.3:
|
||||
resolution: {integrity: sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==}
|
||||
|
||||
picocolors@1.0.0:
|
||||
resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==}
|
||||
|
||||
@@ -948,13 +925,6 @@ packages:
|
||||
proxy-from-env@1.1.0:
|
||||
resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==}
|
||||
|
||||
punycode@1.4.1:
|
||||
resolution: {integrity: sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==}
|
||||
|
||||
qs@6.11.2:
|
||||
resolution: {integrity: sha512-tDNIz22aBzCDxLtVH++VnTfzxlfeK5CbqohpSqpJgj1Wg/cQbStNAz3NuqCs5vV+pjBsK4x4pN9HlVh7rcYRiA==}
|
||||
engines: {node: '>=0.6'}
|
||||
|
||||
react-dom@18.2.0:
|
||||
resolution: {integrity: sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==}
|
||||
peerDependencies:
|
||||
@@ -997,9 +967,6 @@ packages:
|
||||
resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==}
|
||||
hasBin: true
|
||||
|
||||
side-channel@1.0.4:
|
||||
resolution: {integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==}
|
||||
|
||||
source-map-js@1.2.0:
|
||||
resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
@@ -1012,6 +979,10 @@ packages:
|
||||
resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
stxer@0.2.4:
|
||||
resolution: {integrity: sha512-OGWnNF2D298I8Z4cRS9AFP5pZaFa7YUqxaJUOhoCMBzxUxO9sMtGw6h4sxyvprTUSvTT3GDcF/9YDfGF6lZkpg==}
|
||||
engines: {node: '>=12'}
|
||||
|
||||
supports-color@5.5.0:
|
||||
resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==}
|
||||
engines: {node: '>=4'}
|
||||
@@ -1042,9 +1013,6 @@ packages:
|
||||
peerDependencies:
|
||||
browserslist: '>= 4.21.0'
|
||||
|
||||
url@0.11.3:
|
||||
resolution: {integrity: sha512-6hxOLGfZASQK/cijlZnZJTq8OXAkt/3YGfQX45vvMYXpZoo8NdWZcY73K108Jf759lS1Bv/8wXnHDTSz17dSRw==}
|
||||
|
||||
varuint-bitcoin@1.1.2:
|
||||
resolution: {integrity: sha512-4EVb+w4rx+YfVM32HQX42AbbT7/1f5zwAYhIujKXKk8NQK+JfRVl3pqT3hjNn/L+RstigmGGKVwHA/P0wgITZw==}
|
||||
|
||||
@@ -1506,67 +1474,54 @@ snapshots:
|
||||
'@noble/hashes': 1.1.5
|
||||
'@scure/base': 1.1.3
|
||||
|
||||
'@stacks/auth@6.9.0':
|
||||
'@stacks/auth@7.0.2':
|
||||
dependencies:
|
||||
'@stacks/common': 6.8.1
|
||||
'@stacks/encryption': 6.9.0
|
||||
'@stacks/network': 6.10.0
|
||||
'@stacks/profile': 6.9.0
|
||||
'@noble/secp256k1': 1.7.1
|
||||
'@stacks/common': 7.0.2
|
||||
'@stacks/encryption': 7.0.2
|
||||
'@stacks/network': 7.0.2
|
||||
'@stacks/profile': 7.0.2
|
||||
cross-fetch: 3.1.8
|
||||
jsontokens: 4.0.1
|
||||
transitivePeerDependencies:
|
||||
- encoding
|
||||
|
||||
'@stacks/common@6.10.0':
|
||||
dependencies:
|
||||
'@types/bn.js': 5.1.2
|
||||
'@types/node': 18.18.4
|
||||
|
||||
'@stacks/common@6.16.0':
|
||||
dependencies:
|
||||
'@types/bn.js': 5.1.2
|
||||
'@types/node': 18.18.4
|
||||
|
||||
'@stacks/common@6.8.1':
|
||||
dependencies:
|
||||
'@types/bn.js': 5.1.2
|
||||
'@types/node': 18.18.4
|
||||
'@stacks/common@7.0.2': {}
|
||||
|
||||
'@stacks/connect-ui@6.0.1':
|
||||
'@stacks/connect-ui@6.5.0':
|
||||
dependencies:
|
||||
'@stencil/core': 2.22.3
|
||||
|
||||
'@stacks/connect@7.2.1':
|
||||
'@stacks/connect@7.9.0':
|
||||
dependencies:
|
||||
'@stacks/auth': 6.9.0
|
||||
'@stacks/connect-ui': 6.0.1
|
||||
'@stacks/network': 6.10.0
|
||||
'@stacks/profile': 6.9.0
|
||||
'@stacks/transactions': 6.16.1
|
||||
'@stacks/auth': 7.0.2
|
||||
'@stacks/common': 7.0.2
|
||||
'@stacks/connect-ui': 6.5.0
|
||||
'@stacks/network': 7.0.2
|
||||
'@stacks/network-v6': '@stacks/network@6.16.0'
|
||||
'@stacks/profile': 7.0.2
|
||||
'@stacks/transactions': 7.0.2
|
||||
'@stacks/transactions-v6': '@stacks/transactions@6.16.1'
|
||||
jsontokens: 4.0.1
|
||||
url: 0.11.3
|
||||
transitivePeerDependencies:
|
||||
- encoding
|
||||
|
||||
'@stacks/encryption@6.9.0':
|
||||
'@stacks/encryption@7.0.2':
|
||||
dependencies:
|
||||
'@noble/hashes': 1.1.5
|
||||
'@noble/secp256k1': 1.7.1
|
||||
'@scure/bip39': 1.1.0
|
||||
'@stacks/common': 6.8.1
|
||||
'@types/node': 18.18.4
|
||||
'@stacks/common': 7.0.2
|
||||
base64-js: 1.5.1
|
||||
bs58: 5.0.0
|
||||
ripemd160-min: 0.0.6
|
||||
varuint-bitcoin: 1.1.2
|
||||
|
||||
'@stacks/network@6.10.0':
|
||||
dependencies:
|
||||
'@stacks/common': 6.10.0
|
||||
cross-fetch: 3.1.8
|
||||
transitivePeerDependencies:
|
||||
- encoding
|
||||
|
||||
'@stacks/network@6.16.0':
|
||||
dependencies:
|
||||
'@stacks/common': 6.16.0
|
||||
@@ -1574,11 +1529,18 @@ snapshots:
|
||||
transitivePeerDependencies:
|
||||
- encoding
|
||||
|
||||
'@stacks/profile@6.9.0':
|
||||
'@stacks/network@7.0.2':
|
||||
dependencies:
|
||||
'@stacks/common': 6.8.1
|
||||
'@stacks/network': 6.10.0
|
||||
'@stacks/transactions': 6.16.1
|
||||
'@stacks/common': 7.0.2
|
||||
cross-fetch: 3.1.8
|
||||
transitivePeerDependencies:
|
||||
- encoding
|
||||
|
||||
'@stacks/profile@7.0.2':
|
||||
dependencies:
|
||||
'@stacks/common': 7.0.2
|
||||
'@stacks/network': 7.0.2
|
||||
'@stacks/transactions': 7.0.2
|
||||
jsontokens: 4.0.1
|
||||
schema-inspector: 2.1.0
|
||||
zone-file: 2.0.0-beta.3
|
||||
@@ -1598,6 +1560,17 @@ snapshots:
|
||||
transitivePeerDependencies:
|
||||
- encoding
|
||||
|
||||
'@stacks/transactions@7.0.2':
|
||||
dependencies:
|
||||
'@noble/hashes': 1.1.5
|
||||
'@noble/secp256k1': 1.7.1
|
||||
'@stacks/common': 7.0.2
|
||||
'@stacks/network': 7.0.2
|
||||
c32check: 2.0.0
|
||||
lodash.clonedeep: 4.5.0
|
||||
transitivePeerDependencies:
|
||||
- encoding
|
||||
|
||||
'@stencil/core@2.22.3': {}
|
||||
|
||||
'@types/babel__core@7.20.5':
|
||||
@@ -1654,12 +1627,13 @@ snapshots:
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
alex-sdk@2.1.4(@stacks/network@6.10.0)(@stacks/transactions@6.16.1):
|
||||
alex-sdk@3.0.0-beta.1(@stacks/common@7.0.2)(@stacks/network@7.0.2)(@stacks/transactions@7.0.2):
|
||||
dependencies:
|
||||
'@stacks/network': 6.10.0
|
||||
'@stacks/transactions': 6.16.1
|
||||
clarity-codegen: 0.5.2(@stacks/transactions@6.16.1)
|
||||
'@stacks/network': 7.0.2
|
||||
'@stacks/transactions': 7.0.2
|
||||
clarity-codegen: 1.0.0-beta.1(@stacks/common@7.0.2)(@stacks/transactions@7.0.2)
|
||||
transitivePeerDependencies:
|
||||
- '@stacks/common'
|
||||
- debug
|
||||
|
||||
ansi-regex@5.0.1: {}
|
||||
@@ -1706,11 +1680,6 @@ snapshots:
|
||||
'@noble/hashes': 1.3.2
|
||||
base-x: 4.0.0
|
||||
|
||||
call-bind@1.0.2:
|
||||
dependencies:
|
||||
function-bind: 1.1.1
|
||||
get-intrinsic: 1.2.1
|
||||
|
||||
caniuse-lite@1.0.30001634: {}
|
||||
|
||||
chalk@2.4.2:
|
||||
@@ -1723,10 +1692,11 @@ snapshots:
|
||||
optionalDependencies:
|
||||
typescript: 5.4.5
|
||||
|
||||
clarity-codegen@0.5.2(@stacks/transactions@6.16.1):
|
||||
clarity-codegen@1.0.0-beta.1(@stacks/common@7.0.2)(@stacks/transactions@7.0.2):
|
||||
dependencies:
|
||||
'@stacks/common': 7.0.2
|
||||
'@stacks/stacks-blockchain-api-types': 7.14.1
|
||||
'@stacks/transactions': 6.16.1
|
||||
'@stacks/transactions': 7.0.2
|
||||
axios: 1.7.2
|
||||
lodash: 4.17.21
|
||||
yargs: 17.7.2
|
||||
@@ -1850,19 +1820,10 @@ snapshots:
|
||||
fsevents@2.3.3:
|
||||
optional: true
|
||||
|
||||
function-bind@1.1.1: {}
|
||||
|
||||
gensync@1.0.0-beta.2: {}
|
||||
|
||||
get-caller-file@2.0.5: {}
|
||||
|
||||
get-intrinsic@1.2.1:
|
||||
dependencies:
|
||||
function-bind: 1.1.1
|
||||
has: 1.0.4
|
||||
has-proto: 1.0.1
|
||||
has-symbols: 1.0.3
|
||||
|
||||
get-tsconfig@4.8.1:
|
||||
dependencies:
|
||||
resolve-pkg-maps: 1.0.0
|
||||
@@ -1871,12 +1832,6 @@ snapshots:
|
||||
|
||||
has-flag@3.0.0: {}
|
||||
|
||||
has-proto@1.0.1: {}
|
||||
|
||||
has-symbols@1.0.3: {}
|
||||
|
||||
has@1.0.4: {}
|
||||
|
||||
is-fullwidth-code-point@3.0.0: {}
|
||||
|
||||
js-tokens@4.0.0: {}
|
||||
@@ -1919,8 +1874,6 @@ snapshots:
|
||||
|
||||
node-releases@2.0.14: {}
|
||||
|
||||
object-inspect@1.12.3: {}
|
||||
|
||||
picocolors@1.0.0: {}
|
||||
|
||||
picocolors@1.0.1: {}
|
||||
@@ -1935,12 +1888,6 @@ snapshots:
|
||||
|
||||
proxy-from-env@1.1.0: {}
|
||||
|
||||
punycode@1.4.1: {}
|
||||
|
||||
qs@6.11.2:
|
||||
dependencies:
|
||||
side-channel: 1.0.4
|
||||
|
||||
react-dom@18.2.0(react@18.2.0):
|
||||
dependencies:
|
||||
loose-envify: 1.4.0
|
||||
@@ -1993,12 +1940,6 @@ snapshots:
|
||||
|
||||
semver@6.3.1: {}
|
||||
|
||||
side-channel@1.0.4:
|
||||
dependencies:
|
||||
call-bind: 1.0.2
|
||||
get-intrinsic: 1.2.1
|
||||
object-inspect: 1.12.3
|
||||
|
||||
source-map-js@1.2.0: {}
|
||||
|
||||
string-width@4.2.3:
|
||||
@@ -2011,6 +1952,17 @@ snapshots:
|
||||
dependencies:
|
||||
ansi-regex: 5.0.1
|
||||
|
||||
stxer@0.2.4(typescript@5.4.5):
|
||||
dependencies:
|
||||
'@stacks/network': 7.0.2
|
||||
'@stacks/stacks-blockchain-api-types': 7.14.1
|
||||
'@stacks/transactions': 7.0.2
|
||||
c32check: 2.0.0
|
||||
ts-clarity: 0.0.26(typescript@5.4.5)
|
||||
transitivePeerDependencies:
|
||||
- encoding
|
||||
- typescript
|
||||
|
||||
supports-color@5.5.0:
|
||||
dependencies:
|
||||
has-flag: 3.0.0
|
||||
@@ -2044,11 +1996,6 @@ snapshots:
|
||||
escalade: 3.1.2
|
||||
picocolors: 1.0.1
|
||||
|
||||
url@0.11.3:
|
||||
dependencies:
|
||||
punycode: 1.4.1
|
||||
qs: 6.11.2
|
||||
|
||||
varuint-bitcoin@1.1.2:
|
||||
dependencies:
|
||||
safe-buffer: 5.2.1
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { AlexSDK, Currency } from "alex-sdk";
|
||||
import { SimulationBuilder } from "./stxer";
|
||||
import { SimulationBuilder } from "stxer";
|
||||
|
||||
const sdk = new AlexSDK()
|
||||
const addr = "SP212Y5JKN59YP3GYG07K3S8W5SSGE4KH6B5STXER"
|
||||
|
||||
@@ -1,313 +0,0 @@
|
||||
import { AccountDataResponse, getNodeInfo, richFetch } from 'ts-clarity';
|
||||
import { Block } from '@stacks/stacks-blockchain-api-types';
|
||||
import { StacksMainnet } from '@stacks/network';
|
||||
import {
|
||||
AnchorMode,
|
||||
ClarityValue,
|
||||
PostConditionMode,
|
||||
type StacksTransaction,
|
||||
bufferCV,
|
||||
contractPrincipalCV,
|
||||
makeUnsignedContractCall,
|
||||
makeUnsignedContractDeploy,
|
||||
makeUnsignedSTXTokenTransfer,
|
||||
serializeCV,
|
||||
stringAsciiCV,
|
||||
tupleCV,
|
||||
uintCV,
|
||||
} from '@stacks/transactions';
|
||||
import { c32addressDecode } from 'c32check';
|
||||
|
||||
// current beta api endpoint
|
||||
const SIMULATION_API_ENDPOINT = 'https://api.stxer.xyz/simulations';
|
||||
|
||||
function runTx(tx: StacksTransaction) {
|
||||
// type 0: run transaction
|
||||
return tupleCV({ type: uintCV(0), data: bufferCV(tx.serialize()) });
|
||||
}
|
||||
|
||||
export interface SimulationEval {
|
||||
contract_id: string;
|
||||
code: string;
|
||||
}
|
||||
|
||||
export function runEval({ contract_id, code }: SimulationEval) {
|
||||
const [contract_address, contract_name] = contract_id.split('.');
|
||||
// type 1: eval arbitrary code inside a contract
|
||||
return tupleCV({
|
||||
type: uintCV(1),
|
||||
data: bufferCV(
|
||||
serializeCV(
|
||||
tupleCV({
|
||||
contract: contractPrincipalCV(contract_address, contract_name),
|
||||
code: stringAsciiCV(code),
|
||||
})
|
||||
)
|
||||
),
|
||||
});
|
||||
}
|
||||
|
||||
export async function runSimulation(
|
||||
block_hash: string,
|
||||
block_height: number,
|
||||
txs: (StacksTransaction | SimulationEval)[]
|
||||
) {
|
||||
const body = Buffer.concat([
|
||||
Buffer.from('sim-v1'),
|
||||
Buffer.alloc(8),
|
||||
Buffer.from(
|
||||
block_hash.startsWith('0x') ? block_hash.substring(2) : block_hash,
|
||||
'hex'
|
||||
),
|
||||
...txs
|
||||
.map((t) => {
|
||||
return 'contract_id' in t && 'code' in t ? runEval(t) : runTx(t);
|
||||
})
|
||||
.map((t) => serializeCV(t)),
|
||||
]);
|
||||
body.writeBigUInt64BE(BigInt(block_height), 6);
|
||||
const rs = await fetch(SIMULATION_API_ENDPOINT, {
|
||||
method: 'POST',
|
||||
body,
|
||||
}).then(async (rs) => {
|
||||
const response = await rs.text();
|
||||
if (!response.startsWith('{')) {
|
||||
throw new Error(`failed to submit simulation: ${response}`);
|
||||
}
|
||||
// console.log(response);
|
||||
return JSON.parse(response) as { id: string };
|
||||
});
|
||||
return rs.id;
|
||||
}
|
||||
|
||||
export class SimulationBuilder {
|
||||
public static new() {
|
||||
return new SimulationBuilder();
|
||||
}
|
||||
private block = NaN;
|
||||
private sender = '';
|
||||
private steps: (
|
||||
| {
|
||||
// contract call
|
||||
contract_id: string;
|
||||
function_name: string;
|
||||
function_args?: ClarityValue[];
|
||||
sender: string;
|
||||
fee: number;
|
||||
}
|
||||
| {
|
||||
// contract deploy
|
||||
contract_name: string;
|
||||
source_code: string;
|
||||
deployer: string;
|
||||
fee: number;
|
||||
}
|
||||
| {
|
||||
// STX transfer
|
||||
recipient: string;
|
||||
amount: number;
|
||||
sender: string;
|
||||
fee: number;
|
||||
}
|
||||
| SimulationEval
|
||||
)[] = [];
|
||||
|
||||
public useBlockHeight(block: number) {
|
||||
this.block = block;
|
||||
return this;
|
||||
}
|
||||
public withSender(address: string) {
|
||||
this.sender = address;
|
||||
return this;
|
||||
}
|
||||
public addSTXTransfer(params: {
|
||||
recipient: string;
|
||||
amount: number;
|
||||
sender?: string;
|
||||
fee?: number;
|
||||
}) {
|
||||
if (params.sender == null && this.sender === '') {
|
||||
throw new Error(
|
||||
'Please specify a sender with useSender or adding a sender paramenter'
|
||||
);
|
||||
}
|
||||
this.steps.push({
|
||||
...params,
|
||||
sender: params.sender ?? this.sender,
|
||||
fee: params.fee ?? 0,
|
||||
});
|
||||
return this;
|
||||
}
|
||||
public addContractCall(params: {
|
||||
contract_id: string;
|
||||
function_name: string;
|
||||
function_args?: ClarityValue[];
|
||||
sender?: string;
|
||||
fee?: number;
|
||||
}) {
|
||||
if (params.sender == null && this.sender === '') {
|
||||
throw new Error(
|
||||
'Please specify a sender with useSender or adding a sender paramenter'
|
||||
);
|
||||
}
|
||||
this.steps.push({
|
||||
...params,
|
||||
sender: params.sender ?? this.sender,
|
||||
fee: params.fee ?? 0,
|
||||
});
|
||||
return this;
|
||||
}
|
||||
public addContractDeploy(params: {
|
||||
contract_name: string;
|
||||
source_code: string;
|
||||
deployer?: string;
|
||||
fee?: number;
|
||||
}) {
|
||||
if (params.deployer == null && this.sender === '') {
|
||||
throw new Error(
|
||||
'Please specify a deployer with useSender or adding a deployer paramenter'
|
||||
);
|
||||
}
|
||||
this.steps.push({
|
||||
...params,
|
||||
deployer: params.deployer ?? this.sender,
|
||||
fee: params.fee ?? 0,
|
||||
});
|
||||
return this;
|
||||
}
|
||||
public addEvalCode(inside_contract_id: string, code: string) {
|
||||
this.steps.push({
|
||||
contract_id: inside_contract_id,
|
||||
code,
|
||||
});
|
||||
return this;
|
||||
}
|
||||
public addMapRead(contract_id: string, map: string, key: string) {
|
||||
this.steps.push({
|
||||
contract_id,
|
||||
code: `(map-get ${map} ${key})`,
|
||||
});
|
||||
return this;
|
||||
}
|
||||
public addVarRead(contract_id: string, variable: string) {
|
||||
this.steps.push({
|
||||
contract_id,
|
||||
code: `(var-get ${variable})`,
|
||||
});
|
||||
return this;
|
||||
}
|
||||
|
||||
private async getBlockInfo() {
|
||||
if (Number.isNaN(this.block)) {
|
||||
const { stacks_tip_height } = await getNodeInfo();
|
||||
this.block = stacks_tip_height;
|
||||
}
|
||||
const info: Block = await richFetch(
|
||||
`https://api.hiro.so/extended/v1/block/by_height/${this.block}?unanchored=true`
|
||||
).then((r) => r.json());
|
||||
if (
|
||||
info.height !== this.block ||
|
||||
typeof info.hash !== 'string' ||
|
||||
!info.hash.startsWith('0x')
|
||||
) {
|
||||
throw new Error(
|
||||
`failed to get block info for block height ${this.block}`
|
||||
);
|
||||
}
|
||||
return {
|
||||
block_height: this.block,
|
||||
block_hash: info.hash.substring(2),
|
||||
index_block_hash: info.index_block_hash.substring(2),
|
||||
};
|
||||
}
|
||||
|
||||
public async run() {
|
||||
console.log(
|
||||
`--------------------------------
|
||||
This product can never exist without your support!
|
||||
|
||||
We receive sponsorship funds with:
|
||||
SP212Y5JKN59YP3GYG07K3S8W5SSGE4KH6B5STXER
|
||||
|
||||
Feedbacks and feature requests are welcome.
|
||||
To get in touch: contact@stxer.xyz
|
||||
--------------------------------`
|
||||
);
|
||||
const block = await this.getBlockInfo();
|
||||
console.log(
|
||||
`Using block height ${block.block_height} hash 0x${block.block_hash} to run simulation.`
|
||||
);
|
||||
const txs: (StacksTransaction | SimulationEval)[] = [];
|
||||
const nonce_by_address = new Map<string, number>();
|
||||
const nextNonce = async (sender: string) => {
|
||||
let nonce = nonce_by_address.get(sender);
|
||||
if (nonce == null) {
|
||||
const url = `https://api.hiro.so/v2/accounts/${sender}?proof=${false}&tip=${block.index_block_hash
|
||||
}`;
|
||||
const account: AccountDataResponse = await richFetch(url).then((r) =>
|
||||
r.json()
|
||||
);
|
||||
nonce_by_address.set(sender, account.nonce + 1);
|
||||
return account.nonce;
|
||||
}
|
||||
nonce_by_address.set(sender, nonce + 1);
|
||||
return nonce;
|
||||
};
|
||||
for (const step of this.steps) {
|
||||
if ('sender' in step && 'function_name' in step) {
|
||||
const nonce = await nextNonce(step.sender);
|
||||
const [contractAddress, contractName] = step.contract_id.split('.');
|
||||
const tx = await makeUnsignedContractCall({
|
||||
contractAddress,
|
||||
contractName,
|
||||
functionName: step.function_name,
|
||||
functionArgs: step.function_args ?? [],
|
||||
nonce,
|
||||
network: new StacksMainnet(),
|
||||
publicKey: '',
|
||||
postConditionMode: PostConditionMode.Allow,
|
||||
anchorMode: AnchorMode.Any,
|
||||
fee: step.fee,
|
||||
});
|
||||
tx.auth.spendingCondition.signer = c32addressDecode(step.sender)[1];
|
||||
txs.push(tx);
|
||||
} else if ('sender' in step && 'recipient' in step) {
|
||||
const nonce = await nextNonce(step.sender);
|
||||
const tx = await makeUnsignedSTXTokenTransfer({
|
||||
recipient: step.recipient,
|
||||
amount: step.amount,
|
||||
nonce,
|
||||
network: new StacksMainnet(),
|
||||
publicKey: '',
|
||||
anchorMode: AnchorMode.Any,
|
||||
fee: step.fee,
|
||||
});
|
||||
tx.auth.spendingCondition.signer = c32addressDecode(step.sender)[1];
|
||||
txs.push(tx);
|
||||
} else if ('deployer' in step) {
|
||||
const nonce = await nextNonce(step.deployer);
|
||||
const tx = await makeUnsignedContractDeploy({
|
||||
contractName: step.contract_name,
|
||||
codeBody: step.source_code,
|
||||
nonce,
|
||||
network: new StacksMainnet(),
|
||||
publicKey: '',
|
||||
postConditionMode: PostConditionMode.Allow,
|
||||
anchorMode: AnchorMode.Any,
|
||||
fee: step.fee,
|
||||
});
|
||||
tx.auth.spendingCondition.signer = c32addressDecode(step.deployer)[1];
|
||||
txs.push(tx);
|
||||
} else if ('code' in step) {
|
||||
txs.push(step);
|
||||
} else {
|
||||
console.log(`Invalid simulation step:`, step);
|
||||
}
|
||||
}
|
||||
const id = await runSimulation(block.block_hash, block.block_height, txs);
|
||||
console.log(
|
||||
`Simulation will be available at: https://stxer.xyz/simulations/mainnet/${id}`
|
||||
);
|
||||
return id;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
import "./App.css";
|
||||
import { StacksMainnet } from "@stacks/network";
|
||||
import { STACKS_MAINNET } from "@stacks/network";
|
||||
import {
|
||||
AppConfig,
|
||||
openContractCall,
|
||||
@@ -46,9 +46,9 @@ function App() {
|
||||
});
|
||||
}, []);
|
||||
|
||||
const [from, setFrom] = useState<Currency>(Currency.STX);
|
||||
const [amount, setAmount] = useState("");
|
||||
const [to, setTo] = useState<Currency>("token-alex" as Currency);
|
||||
const [from, setFrom] = useState<Currency>(Currency.STX);
|
||||
const [to, setTo] = useState<Currency>(Currency.ALEX);
|
||||
|
||||
const valid =
|
||||
from != null &&
|
||||
@@ -163,7 +163,7 @@ function App() {
|
||||
);
|
||||
await openContractCall({
|
||||
...tx,
|
||||
network: new StacksMainnet(),
|
||||
network: STACKS_MAINNET,
|
||||
});
|
||||
}}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user