@bamzzstudio/loka-agent 0.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/README.md +3 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +25 -0
- package/dist/index.js.map +1 -0
- package/package.json +20 -0
package/README.md
ADDED
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type LokaInvoiceDraft, type LokaInvoiceInput } from "@bamzzstudio/loka-core";
|
|
2
|
+
export declare const LOKA_AGENT_NAME = "Loka Settlement Agent";
|
|
3
|
+
export type LokaAgentResult = {
|
|
4
|
+
ok: true;
|
|
5
|
+
agent: {
|
|
6
|
+
name: typeof LOKA_AGENT_NAME;
|
|
7
|
+
action: "prepare-payment-request";
|
|
8
|
+
checks: string[];
|
|
9
|
+
};
|
|
10
|
+
draft: LokaInvoiceDraft;
|
|
11
|
+
};
|
|
12
|
+
export declare function preparePaymentRequest(input: LokaInvoiceInput, options?: {
|
|
13
|
+
baseUrl?: string;
|
|
14
|
+
}): LokaAgentResult;
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqC,KAAK,gBAAgB,EAAE,KAAK,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAEzH,eAAO,MAAM,eAAe,0BAA0B,CAAC;AAEvD,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,EAAE,IAAI,CAAC;IACT,KAAK,EAAE;QACL,IAAI,EAAE,OAAO,eAAe,CAAC;QAC7B,MAAM,EAAE,yBAAyB,CAAC;QAClC,MAAM,EAAE,MAAM,EAAE,CAAC;KAClB,CAAC;IACF,KAAK,EAAE,gBAAgB,CAAC;CACzB,CAAC;AAEF,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,gBAAgB,EACvB,OAAO,GAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAO,GACjC,eAAe,CAyBjB"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { createInvoiceDraft, normalizeText } from "@bamzzstudio/loka-core";
|
|
2
|
+
export const LOKA_AGENT_NAME = "Loka Settlement Agent";
|
|
3
|
+
export function preparePaymentRequest(input, options = {}) {
|
|
4
|
+
const draft = createInvoiceDraft({
|
|
5
|
+
...input,
|
|
6
|
+
note: normalizeText(input.note, "Local payment"),
|
|
7
|
+
customer: normalizeText(input.customer, "Walk-in customer"),
|
|
8
|
+
country: normalizeText(input.country, "Local market"),
|
|
9
|
+
dueLabel: normalizeText(input.dueLabel, "Due now"),
|
|
10
|
+
}, options);
|
|
11
|
+
return {
|
|
12
|
+
ok: true,
|
|
13
|
+
agent: {
|
|
14
|
+
name: LOKA_AGENT_NAME,
|
|
15
|
+
action: "prepare-payment-request",
|
|
16
|
+
checks: [
|
|
17
|
+
"Normalized amount and memo",
|
|
18
|
+
"Hashed invoice fields for onchain receipt",
|
|
19
|
+
"Prepared shareable MiniPay checkout URL",
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
draft,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAgD,MAAM,wBAAwB,CAAC;AAEzH,MAAM,CAAC,MAAM,eAAe,GAAG,uBAAuB,CAAC;AAYvD,MAAM,UAAU,qBAAqB,CACnC,KAAuB,EACvB,UAAgC,EAAE;IAElC,MAAM,KAAK,GAAG,kBAAkB,CAC9B;QACE,GAAG,KAAK;QACR,IAAI,EAAE,aAAa,CAAC,KAAK,CAAC,IAAI,EAAE,eAAe,CAAC;QAChD,QAAQ,EAAE,aAAa,CAAC,KAAK,CAAC,QAAQ,EAAE,kBAAkB,CAAC;QAC3D,OAAO,EAAE,aAAa,CAAC,KAAK,CAAC,OAAO,EAAE,cAAc,CAAC;QACrD,QAAQ,EAAE,aAAa,CAAC,KAAK,CAAC,QAAQ,EAAE,SAAS,CAAC;KACnD,EACD,OAAO,CACR,CAAC;IAEF,OAAO;QACL,EAAE,EAAE,IAAI;QACR,KAAK,EAAE;YACL,IAAI,EAAE,eAAe;YACrB,MAAM,EAAE,yBAAyB;YACjC,MAAM,EAAE;gBACN,4BAA4B;gBAC5B,2CAA2C;gBAC3C,yCAAyC;aAC1C;SACF;QACD,KAAK;KACN,CAAC;AACJ,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@bamzzstudio/loka-agent",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Deterministic invoice agent for Loka payment requests.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"files": ["dist", "README.md"],
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "tsc -p tsconfig.json",
|
|
12
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"@bamzzstudio/loka-core": "^0.1.0"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"typescript": "^5.9.3"
|
|
19
|
+
}
|
|
20
|
+
}
|