diff --git a/.github/workflows/branch-release.yaml b/.github/workflows/branch-release.yaml
new file mode 100644
index 0000000..141318c
--- /dev/null
+++ b/.github/workflows/branch-release.yaml
@@ -0,0 +1,72 @@
+name: Branch Release
+
+on:
+ push:
+ branches:
+ - '**'
+ - '!main'
+
+jobs:
+ branch-release:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ fetch-depth: 0 # Fetch all history to get the latest tag
+
+ - name: Setup Node.js
+ uses: actions/setup-node@v4
+ with:
+ node-version: '20'
+
+ - name: Install pnpm
+ uses: pnpm/action-setup@v2
+ with:
+ version: latest
+
+ - name: Cache pnpm modules
+ uses: actions/cache@v4
+ with:
+ path: |
+ ~/.pnpm-store
+ node_modules
+ src/playground/node_modules
+ key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
+ restore-keys: |
+ ${{ runner.os }}-pnpm-
+
+ - name: Install Dependencies
+ run: pnpm install --frozen-lockfile
+
+ - name: Build
+ run: pnpm run build
+
+ - name: Set Version from Branch
+ run: |
+ BRANCH_NAME=${GITHUB_REF#refs/heads/}
+ BRANCH_NAME=${BRANCH_NAME//\//-} # Replace slashes with dashes
+ SHORT_SHA=$(git rev-parse --short HEAD)
+
+ # Get the latest version tag and increment patch
+ LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0")
+ LATEST_VERSION=${LATEST_TAG#v} # Remove 'v' prefix
+
+ # Split version into major.minor.patch
+ IFS='.' read -r major minor patch <<< "$LATEST_VERSION"
+
+ # Increment patch version
+ patch=$((patch + 1))
+ BASE_VERSION="${major}.${minor}.${patch}"
+
+ VERSION="${BASE_VERSION}-${BRANCH_NAME}-${SHORT_SHA}"
+ pnpm version $VERSION --no-git-tag-version
+
+ - name: Configure NPM Authentication
+ run: |
+ echo "@bitte-ai:registry=https://registry.npmjs.org/" > ~/.npmrc
+ echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> ~/.npmrc
+
+ - name: Publish with npm
+ run: npm publish --access public --tag beta
+ env:
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml
new file mode 100644
index 0000000..965cd30
--- /dev/null
+++ b/.github/workflows/release.yaml
@@ -0,0 +1,54 @@
+name: NPM Publish
+
+on:
+ release:
+ types: [created]
+
+jobs:
+ publish-npm:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Set up Node.js
+ uses: actions/setup-node@v4
+ with:
+ node-version: "20"
+ registry-url: https://registry.npmjs.org/
+
+ - name: Install pnpm
+ uses: pnpm/action-setup@v2
+ with:
+ version: latest
+
+ - name: Cache pnpm modules
+ uses: actions/cache@v4
+ with:
+ path: |
+ ~/.pnpm-store
+ node_modules
+ src/playground/node_modules
+ key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
+ restore-keys: |
+ ${{ runner.os }}-pnpm-
+
+ - name: Install Full Project
+ run: pnpm install --frozen-lockfile
+
+ - name: Build Full Project
+ run: pnpm run build
+
+ - name: Set Package Version to Tag
+ run: |
+ VERSION=${GITHUB_REF#refs/tags/}
+ pnpm version $VERSION --no-git-tag-version
+
+ - name: Publish
+ run: |
+ if [[ "${GITHUB_REF#refs/tags/}" == *-* ]]; then
+ npm publish --access public --tag next
+ else
+ npm publish --access public
+ fi
+ env:
+ NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
diff --git a/README.md b/README.md
index 6b7f7b9..1a156c3 100644
--- a/README.md
+++ b/README.md
@@ -6,17 +6,8 @@ This package contains React helpers for interacting with Bitte Wallet.
-
-
=49?v=A-49+10:A>=17?v=A-17+10:v=A,r(A>=0&&v<_,"Invalid character"),w+=v;}return w}i.prototype._parseBase=function(s,f,_){this.words=[0],this.length=1;for(var w=0,v=1;v<=67108863;v*=f)w++;w--,v=v/f|0;for(var p=s.length-_,S=p%w,A=Math.min(p,p-S)+_,b=0,M=_;M1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},i.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=c;}catch{i.prototype.inspect=c;}else i.prototype.inspect=c;function c(){return (this.red?" v===ra||I(v,l);function j(v,p){if(I(v,p))return v;throw new Error(`Expected valid scalar < ${p}, got ${typeof v} ${v}`)}function q(v){return v===ra?v:j(v,a)}let C=new Map;function D(v){if(!(v instanceof U))throw new Error("ExtendedPoint expected")}class U{constructor(p,S,A,b){if(this.ex=p,this.ey=S,this.ez=A,this.et=b,!R(p))throw new Error("x required");if(!R(S))throw new Error("y required");if(!R(A))throw new Error("z required");if(!R(b))throw new Error("t required")}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(p){if(p instanceof U)throw new Error("extended point not allowed");let{x:S,y:A}=p||{};if(!R(S)||!R(A))throw new Error("invalid affine point");return new U(S,A,xr,c(S*A))}static normalizeZ(p){let S=r.invertBatch(p.map(A=>A.ez));return p.map((A,b)=>A.toAffine(S[b])).map(U.fromAffine)}_setWindowSize(p){this._WINDOW_SIZE=p,C.delete(this);}assertValidity(){let{a:p,d:S}=e;if(this.is0())throw new Error("bad point: ZERO");let{ex:A,ey:b,ez:M,et:k}=this,B=c(A*A),L=c(b*b),z=c(M*M),F=c(z*z),V=c(B*p),oe=c(z*c(V+L)),H=c(F+c(S*c(B*L)));if(oe!==H)throw new Error("bad point: equation left != right (1)");let Q=c(A*b),Ht=c(M*k);if(Q!==Ht)throw new Error("bad point: equation left != right (2)")}equals(p){D(p);let{ex:S,ey:A,ez:b}=this,{ex:M,ey:k,ez:B}=p,L=c(S*B),z=c(M*b),F=c(A*B),V=c(k*b);return L===z&&F===V}is0(){return this.equals(U.ZERO)}negate(){return new U(c(-this.ex),this.ey,this.ez,c(-this.et))}double(){let{a:p}=e,{ex:S,ey:A,ez:b}=this,M=c(S*S),k=c(A*A),B=c(il*c(b*b)),L=c(p*M),z=S+A,F=c(c(z*z)-M-k),V=L+k,oe=V-B,H=L-k,Q=c(F*oe),Ht=c(V*H),ee=c(F*H),ie=c(oe*V);return new U(Q,Ht,ie,ee)}add(p){D(p);let{a:S,d:A}=e,{ex:b,ey:M,ez:k,et:B}=this,{ex:L,ey:z,ez:F,et:V}=p;if(S===BigInt(-1)){let Oi=c((M-b)*(z+L)),ue=c((M+b)*(z-L)),de=c(ue-Oi);if(de===ra)return this.double();let xi=c(k*il*V),pe=c(B*il*F),ce=pe+xi,Mi=ue+Oi,le=pe-xi,ve=c(ce*de),zn=c(Mi*le),be=c(ce*le),ye=c(de*Mi);return new U(ve,zn,ye,be)}let oe=c(b*L),H=c(M*z),Q=c(B*A*V),Ht=c(k*F),ee=c((b+M)*(L+z)-oe-H),ie=Ht-Q,Ai=Ht+Q,se=c(H-S*oe),fe=c(ee*ie),Kn=c(Ai*se),he=c(ee*se),me=c(ie*Ai);return new U(fe,Kn,me,he)}subtract(p){return this.add(p.negate())}wNAF(p){return G.wNAFCached(this,C,p,U.normalizeZ)}multiply(p){let{p:S,f:A}=this.wNAF(j(p,a));return U.normalizeZ([S,A])[0]}multiplyUnsafe(p){let S=q(p);return S===ra?Z:this.equals(Z)||S===xr?this:this.equals(W)?this.wNAF(S).p:G.unsafeLadder(this,S)}isSmallOrder(){return this.multiplyUnsafe(u).is0()}isTorsionFree(){return G.unsafeLadder(this,a).is0()}toAffine(p){let{ex:S,ey:A,ez:b}=this,M=this.is0();p==null&&(p=M?f$:r.inv(b));let k=c(S*p),B=c(A*p),L=c(b*p);if(M)return {x:ra,y:xr};if(L!==xr)throw new Error("invZ was invalid");return {x:k,y:B}}clearCofactor(){let{h:p}=e;return p===xr?this:this.multiplyUnsafe(p)}static fromHex(p,S=false){let{d:A,a:b}=e,M=r.BYTES;p=(0, un.ensureBytes)("pointHex",p,M);let k=p.slice(),B=p[M-1];k[M-1]=B&-129;let L=si.bytesToNumberLE(k);L===ra||(S?j(L,l):j(L,r.ORDER));let z=c(L*L),F=c(z-xr),V=c(A*z-b),{isValid:oe,value:H}=y(F,V);if(!oe)throw new Error("Point.fromHex: invalid y coordinate");let Q=(H&xr)===xr,Ht=(B&128)!==0;if(!S&&H===ra&&Ht)throw new Error("Point.fromHex: x=0 and x_0=1");return Ht!==Q&&(H=c(-H)),U.fromAffine({x:H,y:L})}static fromPrivateKey(p){return h(p).point}toRawBytes(){let{x:p,y:S}=this.toAffine(),A=si.numberToBytesLE(S,r.BYTES);return A[A.length-1]|=p&xr?128:0,A}toHex(){return si.bytesToHex(this.toRawBytes())}}U.BASE=new U(e.Gx,e.Gy,xr,c(e.Gx*e.Gy)),U.ZERO=new U(ra,xr,xr,ra);let{BASE:W,ZERO:Z}=U,G=(0, I_.wNAF)(U,d*8);function K(v){return (0, l$.mod)(v,a)}function T(v){return K(si.bytesToNumberLE(v))}function h(v){let p=d;v=(0, un.ensureBytes)("private key",v,p);let S=(0, un.ensureBytes)("hashed private key",n(v),2*p),A=O(S.slice(0,p)),b=S.slice(p,2*p),M=T(A),k=W.multiply(M),B=k.toRawBytes();return {head:A,prefix:b,scalar:M,point:k,pointBytes:B}}function g(v){return h(v).pointBytes}function m(v=new Uint8Array,...p){let S=si.concatBytes(...p);return T(n(N(S,(0, un.ensureBytes)("context",v),!!i)))}function s(v,p,S={}){v=(0, un.ensureBytes)("message",v),i&&(v=i(v));let{prefix:A,scalar:b,pointBytes:M}=h(p),k=m(S.context,A,v),B=W.multiply(k).toRawBytes(),L=m(S.context,B,M,v),z=K(k+L*b);q(z);let F=si.concatBytes(B,si.numberToBytesLE(z,r.BYTES));return (0, un.ensureBytes)("result",F,d*2)}let f=h$;function _(v,p,S,A=f){let{context:b,zip215:M}=A,k=r.BYTES;v=(0, un.ensureBytes)("signature",v,2*k),p=(0, un.ensureBytes)("message",p),i&&(p=i(p));let B=si.bytesToNumberLE(v.slice(k,2*k)),L,z,F;try{L=U.fromHex(S,M),z=U.fromHex(v.slice(0,k),M),F=W.multiplyUnsafe(B);}catch{return false}if(!M&&L.isSmallOrder())return false;let V=m(b,z.toRawBytes(),L.toRawBytes(),p);return z.add(L.multiplyUnsafe(V)).subtract(F).clearCofactor().equals(U.ZERO)}return W._setWindowSize(8),{CURVE:e,getPublicKey:g,sign:s,verify:_,ExtendedPoint:U,utils:{getExtendedPublicKey:h,randomPrivateKey:()=>o(r.BYTES),precompute(v=8,p=U.BASE){return p._setWindowSize(v),p.multiply(BigInt(3)),p}}}}nl.twistedEdwards=v$;});var R_=E(ol=>{Object.defineProperty(ol,"__esModule",{value:true});ol.montgomery=undefined;var C_=Io(),Co=dn(),As=BigInt(0),U4=BigInt(1);function b$(t){return (0, Co.validateObject)(t,{a:"bigint"},{montgomeryBits:"isSafeInteger",nByteLength:"isSafeInteger",adjustScalarBytes:"function",domain:"function",powPminus2:"function",Gu:"bigint"}),Object.freeze({...t})}function y$(t){let e=b$(t),{P:r}=e,a=C=>(0, C_.mod)(C,r),i=e.montgomeryBits,n=Math.ceil(i/8),o=e.nByteLength,d=e.adjustScalarBytes||(C=>C),u=e.powPminus2||(C=>(0, C_.pow)(C,r-BigInt(2),r));function l(C,D,U){let W=a(C*(D-U));return D=a(D-W),U=a(U+W),[D,U]}function c(C){if(typeof C=="bigint"&&As<=C&&Cs.length)return 1;if(this.length0||!m)&&(f[_]=s+f[_]);return f.join(`
-`)},Z.prototype.renderPartial=function(h,g,m,s){if(m){var f=r(m)?m(h[1]):m[h[1]];if(f!=null){var _=h[6],w=h[5],v=h[4],p=f;return w==0&&v&&(p=this.indentPartial(f,v,_)),this.renderTokens(this.parse(p,s),g,m,p)}}},Z.prototype.unescapedValue=function(h,g){var m=g.lookup(h[1]);if(m!=null)return m},Z.prototype.escapedValue=function(h,g){var m=g.lookup(h[1]);if(m!=null)return G.escape(m)},Z.prototype.rawValue=function(h){return h[1]};var G={name:"mustache.js",version:"4.0.0",tags:["{{","}}"],clearCache:undefined,escape:undefined,parse:undefined,render:undefined,Scanner:undefined,Context:undefined,Writer:undefined,set templateCache(T){K.templateCache=T;},get templateCache(){return K.templateCache}},K=new Z;return G.clearCache=function(){return K.clearCache()},G.parse=function(h,g){return K.parse(h,g)},G.render=function(h,g,m,s){if(typeof h!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+a(h)+'" was given as the first argument for mustache#render(template, view, partials)');return K.render(h,g,m,s)},G.escape=O,G.Scanner=U,G.Context=W,G.Writer=Z,G});});var my=E((f4,hy)=>{var Uc=et("buffer"),Oa=Uc.Buffer;function fy(t,e){for(var r in t)e[r]=t[r];}Oa.from&&Oa.alloc&&Oa.allocUnsafe&&Oa.allocUnsafeSlow?hy.exports=Uc:(fy(Uc,f4),f4.Buffer=_1);function _1(t,e,r){return Oa(t,e,r)}_1.prototype=Object.create(Oa.prototype);fy(Oa,_1);_1.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return Oa(t,e,r)};_1.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var a=Oa(t);return e!==undefined?typeof r=="string"?a.fill(e,r):a.fill(e):a.fill(0),a};_1.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Oa(t)};_1.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Uc.SlowBuffer(t)};});var yy=E((kse,by)=>{var vy=my().Buffer;by.exports=function(e){for(var r={},a=e.length,i=e.charAt(0),n=0;n>=26,g+=s/67108864|0,g+=f>>>26,this.words[m]=f&67108863;}return g!==0&&(this.words[m]=g,this.length++),this},i.prototype.muln=function(h){return this.clone().imuln(h)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(h){var g=O(h);if(g.length===0)return new i(1);for(var m=this,s=0;s>>22,_=w;}_>>>=22,h.words[f-10]=_,_===0&&h.length>10?h.length-=10:h.length-=9;},D.prototype.imulK=function(h){h.words[h.length]=0,h.words[h.length+1]=0,h.length+=2;for(var g=0,m=0;m