-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSecurityAgreement.html
More file actions
1716 lines (1561 loc) · 92.6 KB
/
SecurityAgreement.html
File metadata and controls
1716 lines (1561 loc) · 92.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<!--Author: David Harness 2025-->
<html>
<head>
<meta charset="UTF-8">
<title>Security Agreement</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="/static/css/styleXUMM42.css">
<!-- External Scripts -->
<script src="https://unpkg.com/xrpl@2.0.0/build/xrpl-latest-min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/xrpl-client@2.0.4/dist/browser.min.js"></script>
<script src="https://xumm.app/assets/cdn/xumm-sdk.min.js"></script>
<script src="five-bells-condition.min.js"></script>
<script src="buffer.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2pdf.js/0.10.1/html2pdf.bundle.min.js" integrity="sha512-GsLlZN/3F2ErC5ifS5QtgpiJtWd43JWSuIgh7mbzZ8zBps+dvLusV+eNQATqgA/HdeKFVgA5v3S/cIrLF7QnIg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<!--<script src="/static/js/input-containers.js"></script>-->
</head>
<body style="background-color:rgb(231, 237, 231);">
<div style="font-size: 14px;" id="SecurityAgreementForm">
<h3 style="color:rgb(5, 5, 5); font-size: 18px; text-align:center">Security Agreement</h3>
<p style="font-size: 14px; text-align:center"><strong><label id="TopTokenIDLabel">Token ID: [If NFT is minted]</label></strong></p>
<br>
<p>This security agreement is between,
<span class="form-field-container">
<span class="input-container">
<input id="lenderNameField" type="text" placeholder="Lender Name" maxlength="30" />
<span class="textWidthCalculator"></span>
<label id="lenderNameFirstLabel"></label>
</span>
</span>
<span class="form-field-container">
<span class="input-container">
<input id="lenderIndividualOrBusinessField" type="text" placeholder="an individual or business" maxlength="14" />
<span class="textWidthCalculator"></span>
<label id="lenderIndividualOrBusinessLabel"></label>
</span>
</span>
(the "Lender") and,
<span class="form-field-container">
<span class="input-container">
<input id="borrowerNameField" type="text" placeholder="Borrower Name" maxlength="30" />
<label class="textWidthCalculator" aria-hidden="true"></label>
<label id="borrowerNameFirstLabel"></label>
</span>
</span>
<span class="form-field-container">
<span class="input-container">
<input id="borrowerIndividualOrBusinessField" type="text" placeholder="an individual or business" maxlength="14" />
<label class="textWidthCalculator" aria-hidden="true"></label>
<label id="borrowerIndividualOrBusinessLabel"></label>
</span>
</span>
(the "Borrower").
</p>
<br>
<p>The Borrower is indebted to the Lender in the amount of,
<span class="form-field-container">
<span class="input-container">
<input id="loanAmountField" type="text" placeholder="Loan Amount" maxlength="13" />
<span class="textWidthCalculator"></span>
<label id="loanAmountLabel"></label>
</span>
</span> =
<strong>
<label id="xrpLoanAmountLabel">0.0000</label> XRP
</strong>(the "<strong>Loan</strong>"), wherein
<strong>1 XRP = $<label id="xrpusdLabel">0.00</label></strong>.
The Loan is evidenced by a promissory note effective on the same date as this agreement
(the "<strong>Note</strong>"), a copy of which is attached as <strong>Exhibit A</strong>.
The Note and this agreement are collectively referred to as the "<strong>Loan Documents</strong>."
</p>
<br>
<p>To induce the Lender to provide Loan to the Borrower as evidenced by the Note,
the Borrower has agreed to enter into this security agreement for the benefit of the
Lender and to grant the Lender a security interest in the Secured Property (as defined
below) to secure the prompt payment, performance, and discharge in full of the
Borrower's obligations under the Note.
</p>
<br>
<p align-text="left">The parties therefore agree as follows:
</p>
<br>
<p><strong>1. GRANT OF SECURITY INTEREST.</strong></p>
<p>The Borrower grants to the Lender a security interest in the Secured Property (as defined
in section 2 below) to secure payment of the Loan.
</p>
<br>
<p><strong>2. SECURED PROPERTY.</strong></p>
<p>The secured property consists of all of the Borrower's interest as of the effective date
of this agreement in the following properties and rights, wherever located, whether now
owned or existing or later acquired and arising (the "<strong>Secured Property</strong>"):
</p>
<span class="field-container">
<strong><label id="securedPropertyLabel" for="securedPropertyField"></label></strong>
<span class="textarea-container">
<textarea rows="5" cols="100" id="securedPropertyField" type="text" placeholder="Secured Property"></textarea>
</span>
</span>
<p> </p>
<p><strong>3. INDEBTEDNESS.</strong></p>
<p>This agreement is made to secure payment when due of the Loan. The Loan includes:</p>
<p>(a) all obligations of the Borrower to the Lender under the Note;</p>
<p>(b) all amendments, renewals, or extensions of the above;</p>
<p>(c) all costs incurred by the Lender in establishing, determining, continuing, or
defending the validity or priority of its security interest, or in pursuing its rights
under this agreement or any other Loan Document or in connection with any proceeding
involving the Lender as a result of any financial accommodation to the Borrower; and</p>
<p>(d) all other costs of collecting the Loan, including attorneys' fees.
</p>
<p>The Borrower shall reimburse the Lender for these expenses immediately on demand, and
until paid all costs shall bear interest at the highest per year rate applicable to the
Loan and permitted by law.
</p>
<br>
<p><strong>4. REAFFIRMATION OF LOAN.</strong></p>
<p>The Borrower hereby reaffirms its obligation for the full and punctual payment and
performance of the Note and all other obligations of the Borrower under the Note.
</p>
<br>
<p><strong>5. BORROWER'S OBLIGATIONS.</strong></p>
<ul>
<li>(a) The Borrower shall pay the Loan at the time and in the manner provided in the
Note;</li>
<li>(b) The Borrower shall ensure that the Secured Property remains free of all security
interests other than the rights of the Lender created by this agreement;</li>
<li>(c) The Borrower will defend the Lender's interest in the Secured Property against
the claims of all other persons; and</li>
<li>(d) The Borrower may not transfer any Secured Property while this agreement is in
effect without the prior written consent of the Lender, which consent may be
withheld or given in the Lender's sole discretion.</li>
</ul>
<br>
<p><strong>6. RECORDING OF AGREEMENT.</strong></p>
<p>On the effective date of this agreement, the Borrower will record this agreement and any
security instrument creating a security interest on the Secured Property as required by
law to protect the security interest of the Lender on the Secured Property. The Borrower
shall pay all filing fees and associated expenses incident to this recordation.
</p>
<br>
<p><strong>7. EVENTS OF DEFAULT.</strong></p>
<p>The Borrower will be in default under this agreement if any of the following occurs:</p>
<ul>
<li>(a) A default in the payment of the Loan or any of the obligations contained in this
agreement or in the Loan Documents;</li>
<li>(b) Any representation made to the Lender by the Borrower proving to have been false
in any material respect when made;</li>
<li>(c) Loss, theft, substantial damage, or destruction, or any sale or encumbrance to
which the Lender did not consent in writing, of the Secured Property, or the making
of a levy, seizure, or attachment on that property; or</li>
<li>(d) An Event of Default, as defined in the Note.</li>
</ul>
<br>
<p><strong>8. REMEDIES FOR EVENTS OF DEFAULT.</strong></p>
<p>If an Event of Default occurs, the Lender may declare the Loan immediately due. In
addition, the Lender will have all of the remedies set forth below, and these remedies
are cumulative, so that the Lender may exercise one or more of these remedies until the
Loan is paid in full without right of reinstatement, disgorgement, or repayment by
reason of a preference, other creditor action, or by operation of law:</p>
<ul>
<li>(a) cause all or any portion of the Secured Property to be registered in its name or
the name of its nominee, designee, or assignee;</li>
<li>(b) have the exclusive right to receive all distributions with respect to the
Secured Property;</li>
<li>(c) dispose of the Secured Property, at private or public sale, without
advertisement of the time or place of the sale (or any adjournment), free of any
right of redemption by the Borrower (this right of redemption being expressly waived
by the Borrower), at the price, in the manner, and to the purchaser (including the
Lender) that the Lender determines in its sole discretion. The proceeds of this sale
will be applied to the Loan and the sale expenses (and the Borrower will remain
liable for any deficiencies); or</li>
<li>(d) all other rights and remedies arising under this agreement or applicable law.
</li>
</ul>
<br>
<p><strong>9. RESPONSIBILITY FOR SECURED PROPERTY.</strong></p>
<p>The Borrower assumes all responsibility for the Secured Property, and the Loan will not
be affected by the loss, destruction, damage, or theft of any of the Secured Property or
its unavailability for any reason. The Lender</p>
<ul>
<li>(a) has no duty (either before or after an Event of Default) to collect any amounts
related to the Secured Property or to preserve any rights relating to the Secured
Property, and</li>
<li>(b) has no obligation to clean up or otherwise prepare the Secured Property for
sale.</li>
</ul>
<p>The Borrower remains obligated under each agreement included in the Secured Property. The
exercise of the Lender of any rights under this agreement does not release the Borrower
from its obligations under the agreements included in the Secured Property. The Lender
has no liability under the agreements included in the Secured Property.
</p>
<br>
<p><strong>10. TERMINATION.</strong></p>
<p>This agreement and all rights of the Lender under this agreement will terminate when the
Lender is satisfied that the Loan and all other obligations of the Borrower under the
Loan Documents are paid and performed in full without reinstatement, disgorgement, or
repayment by reason of a preference, other credit or action, or operation of law.
</p>
<br>
<p><strong>11. INCONSISTENCIES.</strong></p>
<p>If any provision of this agreement is inconsistent with any provision in the Note, the
provisions of [this agreement| the promissory note"] will control.
</p>
<br>
<p><strong>12. GOVERNING LAW.</strong></p>
<ul>
<li>(a) <strong>Choice of Law.</strong> The laws of the state of [Choose State] govern
this agreement (without giving effect to its conflicts of law principles).</li>
<li>(b) <strong>Choice of Forum</strong>. Both parties consent to the personal
jurisdiction of the state and federal courts in [Choose County].</li>
</ul>
<br>
<p><strong>13. AMENDMENTS.</strong></p>
<p>No amendment to this agreement will be effective unless it is in writing and signed by
both parties.
</p>
<br>
<p><strong>14. ASSIGNMENT AND DELEGATION.</strong></p>
<ul>
<li>(a) <strong>No Assignment.</strong> The Borrower may not assign any of its rights
under this note. All voluntary assignments of rights are limited by this subsection.
</li>
<li>(b) <strong>No Delegation.</strong> The Borrower may not delegate any performance
under this note.</li>
<li>(c) <strong>Enforceability of an Assignment or Delegation.</strong> If a purported
assignment or purported delegation is made, or if both are made, in violation of
this section, it is void and they are void.</li>
</ul>
<br>
<p><strong>15. COUNTERPARTS; ELECTRONIC SIGNATURES.</strong></p>
<ul>
<li>(a) <strong>Counterparts.</strong> The parties may execute this agreement in any
number of counterparts, each of which is an original but all of which constitute one
and the same instrument.</li>
<li>(b) <strong>Electronic Signatures.</strong> This agreement, agreements ancillary to
this agreement, and related documents entered into in connection with this agreement
are signed when a party's signature is delivered by facsimile, email, or other
electronic medium. These signatures must be treated in all respects as having the
same force and effect as original signatures.</li>
</ul>
<br>
<p><strong>16. SEVERABILITY.</strong></p>
<p>If any one or more of the provisions contained in this agreement is, for any reason, held
to be invalid, illegal, or unenforceable in any respect, that invalidity, illegality, or
unenforceability will not affect any other provisions of this agreement, but this
agreement will be construed as if those invalid, illegal, or unenforceable provisions
had never been contained in this agreement, unless the deletion of those provisions
would result in such a material change as to cause completion of the transactions
contemplated by this agreement to be unreasonable.
</p>
<br>
<p><strong>17. NOTICES.</strong></p>
<ul>
<li>(a) <strong>Writing; Permitted Delivery Methods</strong>. Each party giving or
making any notice, request, demand, or other communication required or permitted by
this agreement shall give that notice in writing and use one of the following types
of delivery, each of which is a writing for purposes of this agreement: personal
delivery, mail (registered or certified mail, postage prepaid, return-receipt
requested), nationally recognized overnight courier (fees prepaid), facsimile, or
email.</li>
<li>(b) <strong>Addresses.</strong> A party shall address notices under this section to
a party at the following addresses:</li>
</ul>
<br>
<ul>
<li>If to the Lender:</li>
<li>
<strong><label id="lenderNameSecondLabel"></label></strong>
</li>
<li>
<span class="form-field-container">
<span class="input-container">
<input id="lenderAddressStreetField" type="text" placeholder="Lender Street Address" maxlength="30" />
<span class="textWidthCalculator"></span>
<label id="lenderStreetLabel"></label>
</span>
</span>
</li>
<li>
<span class="form-field-container">
<span class="input-container">
<input id="lenderAddressCityField" type="text" placeholder="Lender City" maxlength="30" />
<span class="textWidthCalculator"></span>
<label id="lenderCityLabel"></label>
</span>
</span>
<span class="form-field-container">
<span class="input-container">
<input id="lenderStateField" type="text" placeholder="Lender State" maxlength="30" />
<span class="textWidthCalculator"></span>
<label id="lenderStateLabel"></label>
</span>
</span>
<span class="form-field-container">
<span class="input-container">
<input id="lenderZipField" type="text" placeholder="Lender Zip" maxlength="11" />
<span class="textWidthCalculator"></span>
<label id="lenderZipLabel"></label>
</span>
</span>
</li>
<li>
<span class="form-field-container">
<span class="input-container">
<input id="lenderEmailField" type="text" placeholder="Lender Email" maxlength="30" />
<span class="textWidthCalculator"></span>
<label id="lenderEmailLabel"></label>
</span>
</span>
</li>
<li>
<span class="form-field-container">
<span class="input-container">
<input id="lenderXRPaddressField" type="text" placeholder="Lender XRP Address" maxlength="35" />
<span class="textWidthCalculator"></span>
<label id="lenderXRPaddressLabel"></label>
</span>
</span>
</li>
</ul>
<br>
<ul>
<li>If to the Borrower:</li>
<li>
<strong><label id="borrowerNameSecondLabel"></label></strong>
</li>
<li>
<span class="form-field-container">
<span class="input-container">
<input id="borrowerAddressStreetField" type="text" placeholder="Borrower Street Address" maxlength="40" />
<span class="textWidthCalculator"></span>
<label id="borrowerStreetLabel"></label>
</span>
</span>
</li>
<li>
<span class="form-field-container">
<span class="input-container">
<input id="borrowerAddressCityField" type="text" placeholder="Borrower City" maxlength="30" />
<span class="textWidthCalculator"></span>
<label id="borrowerCityLabel"></label>
</span>
</span>
<span class="form-field-container">
<span class="input-container">
<input id="borrowerStateField" type="text" placeholder="Borrower State" maxlength="30" />
<span class="textWidthCalculator"></span>
<label id="borrowerStateLabel"></label>
</span>
</span>
<span class="form-field-container">
<span class="input-container">
<input id="borrowerZipField" type="text" placeholder="Borrower Zip" maxlength="11" />
<span class="textWidthCalculator"></span>
<label id="borrowerZipLabel"></label>
</span>
</span>
<li>
<span class="form-field-container">
<span class="input-container">
<input id="borrowerEmailField" type="text" placeholder="Borrower Email" maxlength="40" />
<span class="textWidthCalculator"></span>
<label id="borrowerEmailLabel"></label>
</span>
</span>
</li>
<li>
<span class="form-field-container">
<span class="input-container">
<input id="borrowerXRPaddressField" type="text" placeholder="Borrower XRP Address" maxlength="35" />
<span class="textWidthCalculator"></span>
<label id="borrowerXRPaddressLabel"></label>
</span>
</span>
</li>
<br>
<li>(c) <strong>Effectiveness.</strong> A notice is effective only if the party giving
notice complies with subsections (a) and (b) and if the recipient receives the
notice.
</li>
</ul>
<br>
<p><strong>18. WAIVER.</strong></p>
<p>No waiver of a breach, failure of any condition, or any right or remedy contained in or
granted by the provisions of this agreement will be effective unless it is in writing
and signed by the party waiving the breach, failure, right, or remedy. No waiver of any
breach, failure, right, or remedy will be deemed a waiver of any other breach, failure,
right, or remedy, whether or not similar, and no waiver will constitute a continuing
waiver, unless the writing so specifies.
</p>
<br>
<p><strong>19. ENTIRE AGREEMENT.</strong></p>
<p>This agreement, together with the other Loan Documents, constitutes the final agreement
of the parties. It is the complete and exclusive expression of the parties' agreement
with respect to the subject matter of this agreement. All prior and contemporaneous
communications, negotiations, and agreements between the parties relating to the subject
matter of this agreement are expressly merged into and superseded by this agreement. The
provisions of this agreement may not be explained, supplemented, or qualified by
evidence of trade usage or a prior course of dealings. Neither party was induced to
enter this agreement by, and neither party is relying on, any statement, representation,
warranty, or agreement of the other party except those set forth expressly in this
agreement. Except as set forth expressly in this agreement, there are no conditions
precedent to this agreement's effectiveness.
</p>
<br>
<p><strong>20. HEADINGS.</strong></p>
<p>The descriptive headings of the sections and subsections of this agreement are for
convenience only, and do not affect this agreement's construction or interpretation.
</p>
<br>
<p><strong>21. EFFECTIVENESS.</strong></p>
<p>This agreement will become effective when all parties have signed it. The date this
agreement is signed by the last party to sign it (as indicated by the date associated
with that party's signature) will be deemed the date of this agreement.
</p>
<br>
<p><strong>22. NECESSARY ACTS; FURTHER ASSURANCES.</strong></p>
<p>Each party shall use all reasonable efforts to take, or cause to be taken, all actions
necessary or desirable to consummate and make effective the transactions this agreement
contemplates or to evidence or carry out the intent and purposes of this agreement.
</p>
<br>
<p><span className="text-center">[SIGNATURE PAGE FOLLOWS]</span></p>
<p class="pagebreak">Each party is signing this agreement on the date stated opposite that party's signature.</p>
<!-- ========================================= NOT AUTHORIZED ADDRESS LABEL ================================== -->
<strong><label class="mt-3 h4" style="color: #bb0a1e;" id="notAuthorizedAddressLabel"></label></strong>
<button class="button-save" style="display: none;" id="notAuthorizedAddressLogoutButton">Retry</button>
<!-- ========================================================================================================== -->
<br>
<p style="font-size: 14px; text-align:center"><strong><label id="accountNFTHashLabel">Token ID: [If NFT is minted]</label></strong></p>
<br>
<ul><li>
<strong><label id="lenderNameThirdLabel"></label></strong>
</li>
<li>
<span class="form-field-container">
<span class="input-container">
<input id="signingLenderAgentNameField" type="text" placeholder="Lender Agent Name" maxlength="30" />
<span class="textWidthCalculator"></span>
<label id="signingLenderAgentNameLabel"></label>
</span>
</span>
<span class="form-field-container">
<span class="input-container">
<input id="signingLenderAgentTitleField" type="text" placeholder="Lender Agent Title" maxlength="30" />
<span class="textWidthCalculator"></span>
<label id="signingLenderAgentTitleLabel"></label>
</span>
</span>
</li>
<li>
<label id="step_1" style="display: block;">1. Lender sign in with Xaman wallet XRP address:</label>
<strong><label class="mt-3 h4" id="sub_1"></label></strong>
<button class="button-long" style="display: block;" id="lenderSignIn">Lender Xaman Wallet SignIn</button>
</li>
<li>
<label id="step_2" style="display: block;">2. Lender sign Agreement & deposit Escrow XRP Loan (cancel & return via XRP Toolkit if Borrower does not sign):</label>
<button class="button-long" style="display: block;" id="lenderEscrowCreate">Sign Agreement -> Deposit Loan</button>
</li>
<li>
<label id="step_3" style="display: block;">3. Get Agreement EscrowCreate Transaction hash viewable in XRP Explorer link:</label>
<label id="step_3a" style="display: none;"></label>
<button class="button-long" style="display: block;" id='getEscrowHashSequenceButton' onclick="getEscrowHashSequence();">Get EscrowCreate XRPL tx.hash</button>
</li>
<li>
Signed By:<strong><label id="signedByLenderAgentName" style="font-size: 18px; font-family: 'Brush Script MT'"></label>
<label id="signedByLenderAgentTitle" style="font-size: 18px; font-family: 'Brush Script MT'"></label></strong>
</li>
<li>
Date:<strong><label id="lenderEscrowSignedDateLabel"></label></strong>
</li>
<li>
<strong><label id="escrowCreateHashLabel" style="font-size: 15px;">EscrowCreate tx.hash: </label></strong><br>
</li>
<li>
<label id="step_4" style="display: block;">4. Lender Logout:</label>
<button class="button-XUMM" style="display: block;" id="lenderLogout">Lender Logout</button>
</li>
<br>
</ul>
<ul><li>
<strong><label id="borrowerNameThirdLabel"></label></strong>
</li>
<li>
<span class="form-field-container">
<span class="input-container">
<input id="signingBorrowerAgentNameField" type="text" placeholder="Buyer Agent Name" maxlength="40" />
<span class="textWidthCalculator"></span>
<label id="signingBorrowerAgentNameLabel"></label>
</span>
</span>
<span class="form-field-container">
<span class="input-container">
<input id="signingBorrowerAgentTitleField" type="text" placeholder="Buyer Agent Title" maxlength="40" />
<span class="textWidthCalculator"></span>
<label id="signingBorrowerAgentTitleLabel"></label>
</span>
</span>
</li>
<li>
<label id="step_5" style="display: block;">5. Borrower sign in with Xaman wallet XRP address:</label>
<strong><label class="mt-3 h4" id="sub_2">(please sign in after Lender logs out)</label></strong>
<button class="button-long" style="display: block;" id="borrowerSignIn">Borrower Xaman Wallet SignIn</button>
</li>
<li>
<label id="step_5a" style="display: block;">2. Borrower Mint Tolken ID (Borrower is Security Agreement NFT Owner):</label>
<strong><label class="mt-3 h4" id="tok_1"></label></strong>
<button class="button-long" style="display: block;" id="MintTokenIDYes">Mint Token ID Yes</button>
<strong><label class="mt-3 h4" id="tok_2"></label></strong>
<button class="button-long" style="display: block;" id="MintTokenIDNo">Mint Token ID No</button>
</li>
<li>
<label id="step_5b" style="display: block;">3. Get Mint Token Transaction hash viewable in XRP Explorer link:</label>
<label id="step_5c" style="display: none;"></label>
<button class="button-long" style="display: block;" id='getAccountNFTHashButton' onclick="getAccountNFTHash();">Get Token ID Hash</button>
</li>
<li>
<label id="step_6" style="display: block;">6. Borrower sign Agreement & receive Escrow XRP Loan:</label>
<button class="button-long" style="display: block;" id="borrowerEscrowFinish">Sign Agreement -> Receive Loan</button>
</li>
<li>
<label id="step_7" style="display: block;">7. Get Agreement EscrowFinish Transaction hash viewable in XRP Explorer Link:</label>
<button class="button-long" style="display: block;" id='getEscrowFinishHashButton' onclick="getEscrowFinishHash();">Get EscrowFinish XRPL tx.hash</button>
</li>
<li>
Signed By:<strong><label id="signedByBorrowerAgentName" style="font-size: 18px; font-family: 'Brush Script MT'"></label>
<label id="signedByBorrowerAgentTitle" style="font-size: 18px; font-family: 'Brush Script MT'"></label></strong>
</li>
<li>
Date:<strong><label id="borrowerEscrowSignedDateLabel"></label></strong>
</li>
<li>
<strong><label id="escrowFinishHashLabel" style="font-size: 15px;">EscrowFinish tx.hash: </label></strong><br>
</li>
<br>
</ul>
<p>[PROMISSORY NOTE FOLLOWS]</p>
<span class="pagebreak" className="text-center"></span>
<strong><p>EXHIBIT A</p></strong>
<span class="field-container">
<strong><label id="promissaryNoteLabel" for="promissaryNoteField"></label></strong>
<span class="textarea-container">
<textarea rows="5" cols="100" id="promissaryNoteField" type="text" placeholder="[Enter promissory note]"></textarea>
</span>
</span>
<ul>
<li>
<label id="step_8" style="display: block;">8. Borrower Logout:</label>
<button class="button-XUMM" style="display: block;" id="borrowerLogout">Borrower Logout</button>
</li>
<li>
<label id="step_9" style="display: block;">9. Generate PDF download</label>
<button class="button-XUMM" id='generatePDF' style="display: block;">Generate PDF</button>
</li>
</ul>
</div>
<!-- ============================== END OF SECURITY AGREEMENT FORM =================================== -->
<!-- ================================== XRPUSD CALCULATIONS ========================================== -->
<script>
let xrpusd = 0;
let lastFetched = 0;
const fetchInterval = 60 * 60 * 1000; // 1 hour
// Function to fetch XRP to USD rate using CoinGecko API
async function fetchXRPUSD() {
const now = Date.now();
if (xrpusd === 0 || (now - lastFetched) > fetchInterval) {
try {
const response = await fetch('https://api.coingecko.com/api/v3/simple/price?ids=ripple&vs_currencies=usd');
const data = await response.json();
xrpusd = data.ripple.usd;
lastFetched = now;
document.getElementById('xrpusdLabel').innerText = xrpusd.toFixed(2);
console.log('1 XRP = $' + xrpusd);
} catch (error) {
console.error('Error fetching XRP to USD rate:', error);
xrpusd = 0;
document.getElementById('xrpusdLabel').innerText = '0.00';
}
}
}
// Function to calculate Loan Amount in XRP
function calculateLoanAmountXRP() {
const loanAmount = parseFloat(document.getElementById('loanAmountField').value);
if (isNaN(loanAmount) || xrpusd === 0) {
document.getElementById('xrpLoanAmountLabel').innerText = '0.0000';
return;
}
const loanAmountXRP = loanAmount / xrpusd;
document.getElementById('xrpLoanAmountLabel').innerText = loanAmountXRP.toFixed(4);
console.log(`Loan amount = $${loanAmount} = ${loanAmountXRP.toFixed(4)} XRP`);
}
document.addEventListener("DOMContentLoaded", () => {
// Fetch XRP to USD rate on page load
fetchXRPUSD();
// Add event listeners to calculate amounts on input
document.getElementById('loanAmountField').addEventListener('input', calculateLoanAmountXRP);
document.getElementById('agentPercentField').addEventListener('input', calculateAgentAmount);
});
// ============================= generatePDF() =================================
document.getElementById('generatePDF').onclick = async () => {
document.getElementById('step_9').style.display = 'none';
document.getElementById('generatePDF').style.display = 'none';
var element = document.getElementById('SecurityAgreementForm');
var opt = {
margin: 1,
filename: 'SecurityAgreement.pdf',
image: { type: 'jpeg', quality: 0.98 },
html2canvas: { scale: 2, willReadFrequently: true },
jsPDF: { unit: 'in', format: 'letter', orientation: 'portrait' },
enableLinks: true,
pagebreak: { mode: ['avoid-all', 'css'], before: '.pagebreak' }
};
var worker = html2pdf().set(opt).from(element).outputPdf('bloburl');
html2pdf().set(opt).from(element).toPdf().save();
}
</script>
<!-- ================================= XUMM MODULE SCRIPT ========================================== -->
<script type="module">
import 'https://xumm.app/assets/cdn/xumm-oauth2-pkce.min.js?v=2.7.1'
const xumm = new XummPkce('756e02e8-4dbc-4827-8917-e1fd94e62f58', {
implicit: true,
redirectUrl: document.location.href + '?custom_state=test'
})
document.getElementById('lenderSignIn').onclick = () => xumm.authorize().catch(e => console.log('e', e))
document.getElementById('borrowerSignIn').onclick = () => xumm.authorize().catch(e => console.log('e', e))
const signedIn = async () => {
const state = await xumm.state()
if (state?.me?.sub) {
if (state.me.sub === document.getElementById('lenderXRPaddressField').value) {
document.getElementById('lenderSignIn').style.display = 'none'
document.getElementById('step_1').style.display = 'none'
document.getElementById('sub_1').innerText = 'Signed with XRP Address: ' + state.me.sub
document.getElementById('signedByLenderAgentName').innerText = ' ' + document.getElementById('signingLenderAgentNameField').value + ', ';
document.getElementById('signedByLenderAgentTitle').innerText = document.getElementById('signingLenderAgentTitleField').value;
} else if (state.me.sub === document.getElementById('borrowerXRPaddressField').value) {
document.getElementById('borrowerSignIn').style.display = 'none'
document.getElementById('step_5').style.display = 'none'
document.getElementById('sub_2').innerText = 'Signed with XRP Address: ' + state.me.sub
document.getElementById('signedByBorrowerAgentName').innerText = ' ' + document.getElementById('signingBorrowerAgentNameField').value + ', ';
document.getElementById('signedByBorrowerAgentTitle').innerText = document.getElementById('signingBorrowerAgentTitleField').value;
} else {
document.getElementById('notAuthorizedAddressLogoutButton').style.display = 'block'
alert("ADDRESS NOT AUTHORIZED TO SIGN THIS DOCUMENT");
document.getElementById('notAuthorizedAddressLabel').innerText =
"xxxxxx ADDRESS NOT AUTHORIZED TO SIGN THIS DOCUMENT xxxxxx";
xumm.logout()
document.getElementById('lenderSignIn').style.display = 'block'
document.getElementById('borrowerSignIn').style.display = 'block'
}
}
}
document.getElementById('lenderEscrowCreate').onclick = async () => {
const decoder = new TextDecoder();
const encoder = new TextEncoder();
const message = 'Security Agreement Step 2';
const messageAsUint8Array = encoder.encode(message);
const hex = Array.from(messageAsUint8Array)
.map(b => b.toString(16).padStart(2, '0'))
.join('')
.toUpperCase();
console.log('Lender EscrowCreate hex: ' + hex);
const rippleOffset = 946684800;
const cancelAfter = Math.floor(Date.now() / 1000) + (15*60) - rippleOffset;
console.log('Escrow created: ' + Date());
generateConditionsFulfillment();
document.getElementById('step_2').style.display = 'none';
document.getElementById('lenderEscrowCreate').style.display = 'none';
const loanAmount = parseFloat(document.getElementById('loanAmountField').value);
console.log('loanAmountXRP: ' + loanAmount);
const loanAmountXRPdrops = loanAmount.toFixed(5) * 1_000_000;
console.log('loanAmountXRPdrops: ' + loanAmountXRPdrops);
const lenderXRPaddress = document.getElementById('lenderXRPaddressField').value;
const borrowerXRPaddress = document.getElementById('borrowerXRPaddressField').value;
console.log('Lender XRP Address: ' + lenderXRPaddress);
console.log('Borrower XRP Address: ' + borrowerXRPaddress);
const { sdk } = await xumm.state()
const payload = await sdk.payload.create({
TransactionType: 'EscrowCreate',
Account: lenderXRPaddress,
Amount: String(loanAmountXRPdrops),
Destination: borrowerXRPaddress,
CancelAfter: cancelAfter,
Condition: condition,
Memos: [{ Memo: {
MemoData: hex
}
}],
})
if (payload.pushed) {
alert('Payload `' + payload.uuid + '` pushed to your phone.')
} else {
// You can also render `payload.refs.qr_png` in your UI
alert('Payload not pushed, opening payload...')
window.open(payload.next.always)
}
}
document.getElementById('borrowerEscrowFinish').onclick = async () => {
const decoder = new TextDecoder();
const encoder = new TextEncoder();
const message = 'Security Agreement Step 6';
const messageAsUint8Array = encoder.encode(message);
const hex = Array.from(messageAsUint8Array)
.map(b => b.toString(16).padStart(2, '0'))
.join('')
.toUpperCase();
console.log('Borrower EscrowFinish hex: ' + hex);
document.getElementById('step_6').style.display = 'none';
document.getElementById('borrowerEscrowFinish').style.display = 'none';
const borrowerXRPaddress = document.getElementById('borrowerXRPaddressField').value;
const lenderXRPaddress = document.getElementById('lenderXRPaddressField').value;
const { sdk } = await xumm.state()
const payload = await sdk.payload.create({
TransactionType: 'EscrowFinish',
Account: borrowerXRPaddress,
Owner: lenderXRPaddress,
OfferSequence: sequence,
Condition: condition,
Fulfillment: fulfillment,
Fee: 500,
Memos: [{ Memo: {
MemoData: hex
}
}],
})
if (payload.pushed) {
alert('Payload `' + payload.uuid + '` pushed to your phone.')
} else {
// You can also render `payload.refs.qr_png` in your UI
alert('Payload not pushed, opening payload...')
window.open(payload.next.always)
}
}
document.getElementById('MintTokenIDYes').onclick = async () => {
const decoder = new TextDecoder();
const encoder = new TextEncoder();
const message = 'Security Agreement Step 2: Mint Token ID';
const messageAsUint8Array = encoder.encode(message);
const hex = Array.from(messageAsUint8Array)
.map(b => b.toString(16).padStart(2, '0'))
.join('')
.toUpperCase();
console.log('Lender NFTokenMint Memo: ' + hex);
const URImessage = 'smartlegalcontracts.net';
const URImessageAsUint8Array = encoder.encode(message);
const URIhex = Array.from(URImessageAsUint8Array)
.map(b => b.toString(16).padStart(2, '0'))
.join('')
.toUpperCase();
console.log('Lender NFTokenMint URI: ' + URIhex);
document.getElementById('step_2').style.display = 'none';
document.getElementById('MintTokenIDYes').style.display = 'none';
document.getElementById('MintTokenIDNo').style.display = 'none';
const borrowerXRPaddress = document.getElementById('borrowerXRPaddressField').value;
console.log('NFTokenMint Borrower XRP Address: ' + borrowerXRPaddress);
const { sdk } = await xumm.state()
const payload = await sdk.payload.create({
TransactionType: 'NFTokenMint',
"Account": borrowerXRPaddress,
"URI": URIhex,
"Flags": 8,
"TransferFee": 0,
"NFTokenTaxon": 0,
Memos: [{ Memo: {
MemoData: hex
}
}],
})
if (payload.pushed) {
alert('Payload `' + payload.uuid + '` pushed to your phone.')
} else {
alert('Payload not pushed, opening payload...')
window.open(payload.next.always)
}
}
document.getElementById('MintTokenIDNo').onclick = async () => {
document.getElementById('step_2').style.display = 'none';
document.getElementById('MintTokenIDYes').style.display = 'none';
document.getElementById('MintTokenIDNo').style.display = 'none';
document.getElementById('getAccountNFTHashButton').style.display = 'none';
document.getElementById('TopTokenIDLabel').style.display = 'none';
document.getElementById('accountNFTHashLabel').style.display = 'none';
}
document.getElementById('lenderLogout').onclick = () => {
xumm.logout()
document.getElementById('step_4').style.display = 'none';
document.getElementById('lenderLogout').style.display = 'none'
}
document.getElementById('borrowerLogout').onclick = () => {
xumm.logout()
document.getElementById('step_8').style.display = 'none'
document.getElementById('borrowerLogout').style.display = 'none'
}
document.getElementById('notAuthorizedAddressLogoutButton').onclick = () => {
xumm.logout()
document.getElementById('notAuthorizedAddressLogoutButton').style.display = 'none'
document.getElementById('notAuthorizedAddressLabel').innerText = ' '
}
xumm.on("error", error => console.log("error", error))
xumm.on("success", () => signedIn())
xumm.on("retrieved", () => signedIn())
</script>
<!-- ==================== END Xumm jsmodule-payload.html =================== -->
<script>
// =========================== CreateEscrow Hash ==========================
var escrowCreateHash;
var sequence;
async function getEscrowHashSequence() {
const lenderXRPaddress = document.getElementById('lenderXRPaddressField').value;
if (!lenderXRPaddress) {
console.error("Lender XRP address is empty or not provided.");
alert("Please enter a valid Lender XRP address before proceeding.");
return;
}
console.log('Lender XRP Address: ' + lenderXRPaddress);
const api = new xrpl.Client('wss://xrplcluster.com/');
await api.connect();
let response = await api.request({
"command": "account_objects",
"account": lenderXRPaddress,
"type": "escrow"
});
escrowCreateHash = response.result.account_objects[0].PreviousTxnID;
console.log("PreviousTxnID = hash: " + escrowCreateHash);
// const escrowCreateHashLink = "https://test.xrplexplorer.com/explorer/";
const escrowCreateHashLink = "https://xrplexplorer.com/explorer/";
const xrpExplorerLink = escrowCreateHashLink.concat(escrowCreateHash);
document.getElementById('getEscrowHashSequenceButton').style.display = 'none';
document.getElementById('lenderEscrowSignedDateLabel').innerText = ' ' + Date();
const link = document.createElement('a');
link.href = xrpExplorerLink;
link.target = "_blank";
link.rel = "noopener noreferrer";
link.innerText = escrowCreateHash;
const label = document.getElementById('escrowCreateHashLabel');
label.innerText = "tx.hash: ";
label.appendChild(link);
// Set the timer to start 15 minutes from now, update every second
const startTime = Date.now() + 15 * 60 * 1000;
const interval = setInterval(() => {
const remainingTime = Math.round((startTime - Date.now()) / 1000);
if (remainingTime < 0) {
clearInterval(interval);
console.log('Timer has ended');
} else {
const label2 = document.getElementById('step_3');
label2.innerText = "Lender can Cancel if Borrower does not sign after: " + remainingTime + " seconds via: ";
const link2 = document.createElement('a');
link2.href = "https://www.xrptoolkit.com/escrow";
link2.target = "_blank";
link2.rel = "noopener noreferrer";
link2.innerText = "XRP Toolkit";
label2.appendChild(link2);
}
}, 1000);
let response2 = await api.request({
"command": "tx",
"transaction": escrowCreateHash,
"binary": false
});
sequence = response2.result.Sequence;
console.log("Sequence: " + sequence);
}
<!-- ========================== FinishEscrow Hash ========================== -->
var escrowFinishHash;
async function getEscrowFinishHash() {
const borrowerXRPaddress = document.getElementById('borrowerXRPaddressField').value;
const api = new xrpl.Client('wss://xrplcluster.com/');
await api.connect();
let response3 = await api.request({
"command": "account_tx",
"account": borrowerXRPaddress
});
escrowFinishHash = response3.result.transactions[0].tx.hash;
console.log("EscrowFinish tx.hash: " + escrowFinishHash);
const escrowFinishHashLink = "https://bithomp.com/explorer/";
const xrpExplorerLink = escrowFinishHashLink.concat(escrowFinishHash);
document.getElementById('step_3').style.display = 'none';
document.getElementById('step_7').style.display = 'none';
document.getElementById('getEscrowFinishHashButton').style.display = 'none';
document.getElementById('borrowerEscrowSignedDateLabel').innerText = " " + Date();
const link3 = document.createElement('a');
link3.href = xrpExplorerLink;
link3.target = "_blank";
link3.rel = "noopener noreferrer";
link3.innerText = escrowFinishHash;
const label = document.getElementById('escrowFinishHashLabel');
label.innerText = "tx.hash: ";
label.appendChild(link3);
}
<!-- ========================== AccountNFT Hash ========================== -->
var accountNFTHash;
document.getElementById('getAccountNFTHashButton').addEventListener('click', getAccountNFTHash);
async function getAccountNFTHash() {
const borrowerXRPaddress = document.getElementById('borrowerXRPaddressField').value.trim();
if (!borrowerXRPaddress) {
console.error("Borrower XRP address is empty or not provided.");
alert("Please enter a valid Borrower XRP address before proceeding.");
return;
}
console.log('Borrower XRP Address: ' + borrowerXRPaddress);
const api = new xrpl.Client('wss://xrplcluster.com/');
await api.connect();
let response = await api.request({
"command": "account_nfts",
"account": borrowerXRPaddress
});
if (response.result.account_nfts && response.result.account_nfts.length > 0) {
accountNFTHash = response.result.account_nfts[0].NFTokenID;
console.log("Account NFT Hash: " + accountNFTHash);
document.getElementById('step_5a').style.display = 'none';
document.getElementById('MintTokenIDYes').style.display = 'none';
document.getElementById('MintTokenIDNo').style.display = 'none';
document.getElementById('step_5b').style.display = 'none';
document.getElementById('getAccountNFTHashButton').style.display = 'none';
const nftExplorerLink = "https://bithomp.com/nft/" + accountNFTHash;
const link = document.createElement('a');
link.href = nftExplorerLink;
link.target = "_blank";
link.rel = "noopener noreferrer";
link.innerText = accountNFTHash;
const label = document.getElementById('accountNFTHashLabel');
label.innerText = "Security Agreement Token ID: ";
label.appendChild(link);
const toplink = document.createElement('a');
toplink.href = nftExplorerLink;
toplink.target = "_blank";
toplink.rel = "noopener noreferrer";
toplink.innerText = accountNFTHash;
const toplabel = document.getElementById('TopTokenIDLabel');
toplabel.innerText = "Token ID: ";
toplabel.appendChild(toplink);
} else {
document.getElementById('accountNFTHashLabel').innerText = "No NFTs found for this account.";
}
}
// Function to adjust the width of an input based on its content
function adjustWidth(input, calculator) {
const inputStyles = window.getComputedStyle(input);
calculator.style.font = inputStyles.font;
calculator.style.fontSize = inputStyles.fontSize;
calculator.style.fontWeight = inputStyles.fontWeight;
calculator.style.fontFamily = inputStyles.fontFamily;
calculator.textContent = input.value || input.placeholder;
// Add padding to mimic the input's padding
const padding = parseInt(inputStyles.paddingLeft) + parseInt(inputStyles.paddingRight);
input.style.width = (calculator.offsetWidth + padding) + "px";
}
// Select all Label input fields and their corresponding calculators
document.addEventListener("DOMContentLoaded", () => {
const inputs = document.querySelectorAll('.input-container input[type="text"]');
const calculators = document.querySelectorAll('.textWidthCalculator');